How to Configure BIND9 DNS Server on Ubuntu 20.04
In this tutorial, we will walk through the installation and basic configuration of the BIND9 DNS server.
How to configure BIND9 DNS Server on Ubuntu 20.04:
Install BIND9
The first thing you need to do is to update the package list and to install BIND9.
sudo apt install bind9
After the installation process is complete, you can check if BIND9 is working.
The answer will be something like this:
Address: 127.0.0.1#53
Name: google.com
Address: 64.233.164.138
...
BIND9 configuration
The DNS server works right after installation. You need to configure it according to your usage purposes. First, allow BIND9 to work through the firewall.
The main configuration file is named.conf.options, let's open it.
Some of the available options are listed below. Add the necessary to the "options" directive.
The "listen-on" directive allows you to specify the networks that the DNS server will serve. Don't write this or write "any;" to work for all addresses.
10.10.10.0/24;
10.1.0.0/16;
...
};
BIND9 only allows local queries by default. Add the necessary IP addresses to the "allow-query" directive or "any;" to allow all requests.
Forwarders contain the IP addresses of DNS servers to which the request is redirected if our server does not contain the required data.
8.8.8.8;
8.8.4.4;
};
Save and close the file. Check the configuration:
If no errors appear, then everything is in order. Restart the service for the changes to take effect.
BIND9 test
To check if the DNS server is working properly, enter the following command on any other remote computer. Replace dns-server-ip-address with the IP address of the DNS server.
Output:
Address: dns-server-ip-address#53
Name: ubuntu.com
Address: 91.189.88.181
...
Now you have a working caching name server BIND9.
Next steps: