When building a network with routers, a DNS server is an essential public service. Today, we will walk you through how to install and configure a DNS server on a Linux system. The network topology consists of three DNS servers (a primary DNS, a subordinate DNS, and a secondary DNS) and one DNS test client. The router settings use the defaults, so we won’t repeat them here.
The Linux distribution used is the very popular CentOS, which is not only stable but also free, and is well-loved by many webmasters.
First, check whether the bind program is installed on CentOS. Using the command rpm 鈥搎a | grep bind, you will find that CentOS has the bind client installed by default but not the server. So, use rpm 鈥搃vh to install the server-side software.
After installing the bind package, you might not see the named.conf file in /etc/, and this file is very complex. Writing it by hand would be very time-consuming, so you need to install the caching-nameserver package. This helps us install many standardized documents. It will provide the data for a pure caching DNS configuration file and also install many zone data files. We just need to modify those files, and that’s it.
Check the named.ca file; this file is essentially the root hints list. The first experiment is to configure the bind software as a caching server, which is very simple. Because caching-nameserver is installed, it is already a caching server. Just start it using /etc/init.d/named start.
If the bind software you installed is version 9.3, the configuration file template is located at /usr/share/doc/bind-9.3/etc/named.conf. You can copy this file over and modify it.
On the client side, use commands like nslookup and dig to check the DNS resolution status.
Then, start up another Linux server and install the bind software to serve as a backup for the original DNS