How to setup DNS BIND service in Ubuntu OS

How to setup DNS BIND service in Ubuntu OS

Purpose – To install and configure the DNS BIND server in Ubuntu for hostname (FQDN) to IP address resolution and vice-versa

OS – Ubuntu 12.04

sudhir@Ubuntu1:~$ cat /etc/lsb-release


Step1: Update the repositories to get the newest versions of the packages and their dependencies

$ sudo apt-get update

Step2: Install bind and its dependent packages

$ sudo apt-get install bind9

Also, install the clients package useful for testing and troubleshooting DNS issues if already not installed

$ sudo apt-get install dnsutils

Step3: Add a DNS zone to bind9, turning bind9 into a primary master server for the domain (Fully Qualified domain name)

Configure the named.conf.local bind file as show below

$ sudo vi /etc/bind/named.conf.local

Step4: Configure the named.conf.options file with the DNS server IP address to which the requests will be forwarded

Step 5: Edit the new zone files with the Fully qualified domain name and the machine names that the DNS server will know

$ sudo mkdir /etc/bind/zones
$ sudo vi /etc/bind/zones/

Step6: Edit the reverse zone file as show below

$ sudo vi /etc/bind/zones/

Step7: Restart the bind9 service as below

$ sudo service bind9 restart


$ sudo /etc/init.d/bind9 restart

Step8: Edit the /etc/resolv.conf with the search domain_name and nameserver IP address as show below

Step9: Test the DNS

Note – Here a static IP address ( has been configured for the Host machine.

Hope you enjoyed reading this article. Thank you.