Do you want to install Bind9 DNS server? Let’s help you.
The BIND DNS servers help to translate website names to IP addresses and vice versa.
However, the installation steps of BIND can be confusing to many users.
That’s why we help customers to set up DNS servers as a part of our Server Management Services.
Today, we’ll see how our Support Engineers install Bind9 DNS server.
Role of Bind9 DNS Server
To begin with, let’s check the importance of DNS servers on the internet.
It is the DNS servers that help us to access a website by its name. It automatically points a domain name to its IP address. And, the server sends back website data to our browser.
There are many DNS servers available. BIND 9 is an open-source DNS that works well in almost all Linux distributions. BIND aka Berkeley Internet Name Domain allows us to publish DNS information and allows us to resolve DNS queries.
Moreover, BIND is the most widely used nameserver too.
Steps to install Bind9 DNS Server
So far we saw why we need the BIND server. Now it’s time to see the steps to install it.
Recently, we received a request from one of our customers.
Could you please help us to set up the DNS server using Bind9 on our Ubuntu server.
- Setup Bind9 DNS server
- After configuring Bind9, map the primary domain in my DNS server.
We’ll now check the different steps that our Support Engineers did in detail.
Add the Bind9 packages
The Bind9 packages are available from Ubuntu’s repository. So we connect to the server as the root user and install it using:
root@server:~$ apt-get install bind9 bind9utils bind9-doc dnsutils
This installs all the related Bind files. Usually, all configuration files for BIND will be located in /etc/bind folder.
Configure DNS Server
Moving on, we configure the Bind9 server.
We begin by tweaking the file /etc/bind/named.conf.options.
In this file, we make changes like:
Allow Query to the DNS from your private network with the entry allow-query { localhost; 192.168.0.0/24; };
Allow recursive query recursion yes;
Specify the DNS port ( 53) listen-on port 53
Forwarders (Servers that reply to DNS query when your local DNS server is unable to resolve query) forwarders { 8.8.8.8; };
Next, we create the zone files for our domains in the /etc/bind folder. For this, we simply copy the sample file and substitute the domain name and IP address.
Then we edit the file /etc/bind/named.conf.local and define the zone file locations for each domain. Here, we include the reverse lookup files as well.
Additionally, we double-check the syntax of the configuration files.
named-checkconf /etc/bind/named.conf.local
Finally, we restart the BIND service.
systemctl restart bind9
systemctl enable bind9
On the successful restart, the status of the Bind9 service appears as:
Testing DNS results
Then we test whether the DNS results are working fine from the new Bind9 server.
For this, we edit the /etc/resolv.conf of a server and set the nameserver as the new Bind9 server. Then we use the dig command to fetch the DNS results of a domain.
If the results show the domain’s IP address correctly, then the DNS server works fine.
Again, the log file at /var/log/messages shows the details of various events in the DNS server. This helps to debug any errors with the DNS queries.
[Trouble configuring the Bind9 server? We are available 24×7 to fix it.]
Conclusion
In short, the BIND9 DNS server helps to translate domain names to IP addresses easily. Today, we saw how our Support Engineers install and configure the DNS server.
0 Comments