Article Title: how to set up a DNS server in Linux. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic categories. There are three main methods to configure DNS servers in Linux: 1. Select the software for installing the DNS server when installing the system. 2. Install the Bind RPM package. 3. Download the Bind software source code and compile and install it. If the first two methods are used, enter "rpm? After q bind, the bind information is displayed; otherwise, no information is displayed. After the Bind is installed, follow these steps:
1. Modify the/etc/host. conf and/etc/resolve. conf files.
The content of the Resolve. conf file is
Domain qtech.edu.cn // domain to be resolved
Nameserver 211.64.192.X // dns Server
The content of host. conf is
Order hosts, bind // first search for the hosts file, and then query dns
Muti on |
2. download the latest named. root file to the/var/named directory.
Ftp://ftp.rs.internic.net/domain anonymous login
3. Create the/etc/named. conf file
Options {
Directory "/opt/named ";
};
Zone "." IN {
Type hint;
File "named. root ";
}; // Root Domain Name Server File
Zone "localhost" IN {
Type master;
File "localhost. zone ";
Allow-update {none ;};
}; // Name resolution of the local host
Zone "0.0.127.in-addr. arpa" IN {
Type master;
File "named. local ";
Allow-update {none ;};
}; // Reverse resolution of the local host
Zone "qtech.edu.cn "{
Type master;
File "qtech.edu.cn. zone ";
Allow-update {none ;};
}; // Domain name resolution
Zone "192.64.211.in-addr. arpa" IN {
Type master;
Files "192. zone ";
Allow-update {none ;};
}; // Forward resolution of the domain name
Key "rndc-key "{
Algorithm hmac-md5;
Secret "7fOaQVYjo1Sw0mb1CHPMO6Q2 ="; // The password must be consistent with the/etc/rndc. key File.
};
Controls {
Inet 127.0.0.1 port 953
Allow {127.0.0.1;} keys {"rndc-key ";};
}; |
4. Create localhost. zone, named. local, qtech.edu.cn. zone, and 192. zone files under the/var/named/directory.
To learn the basics of the configuration file, you can go to the http://www.isc.org/index.pl to download the document of the corresponding bind version.
5. Start the domain name resolution service
1 Service named start/stop/restart or
2 (1) convert/etc/rc. d/init. d/named into an executable file. # Chmod 755/etc/rc. d/init. d/named
(2) Create the startup script symbollink # ln-s/etc/rc. d/init. d/named/etc/rc. d/rc0.d/K45named
(3) start bind9, #/etc/rc. d/init. d/named start/stop/restart
Vi. check and test
After the configuration is complete, run the rndc status Command to check the configuration. If the configuration fails to be configured, check the configuration file again.
You can also run the nslookup qtech.edu.cn command to check whether the resolution is correct? Qt ptr = 211.64.192.2 check whether reverse Parsing is correct.