Data Networking/Spring 2015/GROUP4/DNS-SERVER
STEPS TO CONFIGURE DNS=
editAssign permanent IP through to the DNS server:
IP assigned to the DNS is 192.168.5.6
Install Bind:
Use the following command to install bind9
sudo apt-get install bind9 bind9utils bind9-doc sudo apt-get install dnsutils
Edit the resolv.conf file
nano /etc/resolv.conf
edit the hosts file
nano /etc/hosts
Edit the options file:
It is done to configure the primary DNS. The command used is-
sudo nano /etc/bind/named.conf.options forwarders { 192.168.5.6; 192.168.5.7; }
Configure the local file:
Use the command shown below to access the file.
sudo nano /etc/bind/named.conf.local
Once the file opens, configure the forward and reverse lookup zones.
Create zone directory and forward and reverse files:
To create the zone directory, use the command-
sudo mkdir /etc/bind/z
Copying the content
sudo cp /etc/bind/db.local/etc/bind/z/db.for
The forward lookup zone does hostname > IP address translation and reverse lookup zone does IP address > hostname translation.
Our forward lookup zone file is db.for.com.
Edit the forward lookup zone file by a command specifying the path
sudo nano /etc/bind/z/db.for
Copying the content
sudo cp /etc/bind/db.127/etc/bind/z/db.192
Our reverse lookup zone filename is db.192
Edit the reverse lookup zone file by a command specifying the path
sudo nano /etc/bind/z/db.192
Restart bind:
Finally, restart bind to load the server. Use the command-
sudo service bind9 restart
Testing
editChecking of the forward and reverse zone files
Use the following commands-
- for forward lookup zone
sudo named-checkzone mvrs.com /etc/bind/z/db.for
- for reverse lookup zone
sudo named-checkzone mvrs.com /etc/bind/z/db.192
Checking reverse lookup zone:
Use the command-
nslookup 192.168.5.6
This shows the hostname for the IP address as vivek.fabfour.com which is the name server of Fabfour.
Checking forward lookup zone:
Use the command-
nslookup mvrs.com
This shows the IP address of the host as 192.168.5.9 which is the IP address of the webserver.
Checking host file:
Use the command-
host -l mvrs.com
this will show all the hosts.
Using dig command:
dig mvrs.com