LinuxDNS configuration learning notes

Source: Internet
Author: User
Tags nameserver nslookup
LinuxDNS configuration learning notes-Linux Enterprise Application-Linux server application information. The following is a detailed description. 1. install the software package required by DNS.
Check whether bind software is installed. Enter
[Root @ localhost root] # rpm-qa | grep bind
Redhat-config-bind-1.9.0-13
Bind-9.2.1-16
Bind-utils-9.2.1-16
Ypbind-1.11-4

If the above text is displayed, the installation is successful. If the above content is not inserted into the correct disc, install it, or download the source code for installation.
2. Set the IP address and DNS
Enter netconfig in the terminal, press enter, and enter the IP address in the first line, 172.18.121.35. enter the subnet mask 255.255.255.0 in the second line. Enter the gateway address 172.18.121.1 in the third line, and enter DNS 172.18.121.35 in the last line. confirm again. enter the following command in the terminal.
[Root @ localhost root] # service network reload
[Root @ localhost root] # service network restart
View IP information through ifconfig
3. Configure DNS
Configure DNS forward search. The configuration file is as follows:
[Root @ localhost root] # cp/var/named/localhost. zone/var/named/zljlinux.com
Copy a configuration template file of the local DNS to modify it.
[Root @ localhost root] # vi/var/named/zljlinux.com
$ TTL 86400
$ ORIGIN zljlinux.com.
@ 1D in soa zljlinux.com. root.zljlinux.com .(
42; serial (d. adams)
3 H; refresh
15 M; retry
1 W; expiry
1D); minimum
1D in ns @
1D in mx 5 mail.zljlinux.com.
Www 1D in a 172.18.121.35
Mail 1D in a 172.18.121.35
Ftp 1D in a 172.18.121.35
Pop3 in cname mail.zljlinux.com.
Smtp in cname mail.zljlinux.com.
Save and exit. Press ESC and then: wq.
Configure DNS forward search. The configuration file is as follows:
[Root @ localhost root] # cp/var/named. local/var/named/172.18.121.rev
Copy a configuration template file of the local DNS to modify it.
[Root @ localhost root] # vi/var/named/172.18.121.rev
$ TTL 86400
@ In soa zljlinux.com. root.zljlinux.com .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns zljlinux.com.

35 in ptr www.zljlinux.com.
35 in ptr mail.zljlinux.com.
35 in ptr ftp.zljlinux.com.
Configure a main file of the local DNS. After installation, it has a template to modify it. The modified part is a crude line representation.
[Root @ localhost root] # vi/etc/named. conf
// Generated by named-bootconf.pl
Options {
Directory "/var/named ";
/*
* If there is a firewall between you and nameservers you want
* To talk to, you might need to uncomment the query-source
* Directive below. Previous versions of BIND always asked
* Questions using port 53, but BIND 8.1 uses an unprivileged
* Port by default.
*/
// Query-source address * port 53;
};
//
// A caching only nameserver config
//
Controls {
Inet 127.0.0.1 allow {localhost;} keys {rndckey ;};
};
Zone "." IN {
Type hint;
File "named. ca ";
};
Zone "localhost" IN {
Type master;
File "localhost. zone ";
Allow-update {none ;};
};
Zone "0.0.127.in-addr. arpa" IN {
Type master;
File "named. local ";
Allow-update {none ;};
};
Zone "zljlinux.com" IN {
Type master;
File "zljlinux.com ";
};
Zone "121.18.172.in-addr. arpa" IN {
Type master;
File "172.18.121.rev ";
};
Include "/etc/rndc. key ";
"/Etc/named. conf" [converted] 45L, 894C
Configure the sequence of the local domain name Converter
[Root @ localhost root] # vi/etc/host. conf
Order bind, hosts
Multi off
Trim zljlinux.com
[Root @ localhost root] # vi/etc/resolv. conf
Nameserver 172.18.121.35
Nameserver 218.196.42.2
Namedsever 218.196.42.2
Domain zljlinux.com
Search www.zljlinux.com zljlinux.com
Option nochecknames rotate
4. Start the named service.
[Root @ localhost root] # service named start
5. Check whether the configuration is successful.
[Root @ localhost root] # nslookup
Note: nslookup is deprecated and may be removed from future releases.
Consider using the 'dig' or 'host' programs instead. Run nslookup
The '-sil [ent]' option to prevent this message from appearing.
> Www.zljlinux.com
Server: 172.18.121.35
Address: 172.18.121.35 #53

Name: www.zljlinux.com
Address: 172.18.121.35
> 172.18.121.35
Server: 172.18.121.35
Address: 172.18.121.35 #53

35.121.18.172.in-addr. arpa name = ftp.zljlinux.com.
35.121.18.172.in-addr. arpa name = www.zljlinux.com.
35.121.18.172.in-addr. arpa name = mail.zljlinux.com.
>
Ctrl + D Exit
If the above text is displayed, the configuration is successful.
6. In fact, in the configuration process, can I check whether my configuration is correct through named? G.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.