Installing and Configuring DNS Server BIND9

BIND (Berkeley Internet Name Domain) — open and the most common implementation of the DNS server, which ensures that the DNS name is converted to an IP address and vice versa.

Installing in Linux Ubuntu:

sudo apt-get install bind9

Stop / Start / Restart Bind9:

sudo  /etc/init.d/bind9 stop/start/restart

To use the local DNS, you need to register in /etc/resolv.conf:


We edit the configuration files in the /etc/bind/ directory for your needs.

Open the configuration file named.conf.options for example in the text editor nano:

sudo nano /etc/bind/named.conf.options

First, add ACLs with networks that will be allowed to query the DNS server:

acl localclients {

In options, we specify this ACL by resolving queries:

allow-recursion { localclients; };
allow-query { localclients;};
allow-query-cache { localclients; };

You can specify the IP addresses on which bind9 will work:

listen-on {;;

Alternatively, you can specify the addresses to which recursion is allowed, so that DNS does not serve the requests of all clients, but only those specified (all other unregistered addresses will be able to receive only the information specified in this DNS):

allow-recursion {;;;; };

The correctness of the settings can be checked by the following command (if it did not say anything, it means everything is in order):


Apply the changes:

sudo rndc reload

or so:

sudo  /etc/init.d/bind9 restart


rndc status
netstat -lnp | grep :53
sudo ps -ax | grep bind

From Windows, you can check with the command (where is the address of bind9):


You can clear the cache of the DNS server with:

sudo rndc flush

Save the cache to a file (/var/cache/bind/):

sudo rndc dumpdb

See also:
Configuring Bind9 logs

Подписаться на IT Blog (RU) по Email
Subscribe to IT Blog (EN) by Email

Did my article help you? How about buying me a cup of coffee as an encouragement? Buy me a coffe.

Leave a Reply