How to configure DNS Server on Ubuntu-Linux?

How to configure DNS Server on Ubuntu-Linux?

We know Linux is everywhere. It is a hardware-based operating system. In an easy word, Linux manages the communication between the software and the hardware. In this article, we will discuss the difference between the Linux operators. Finally, we will learn How to configure DNS Server on Ubuntu-Linux.

configure DNS Server on Ubuntu-Linux

There are two types of Linux OS. One of them is the Debian OS, and the other one is the Redhat OS. These two kinds of OS has separate companies made different OS platform. Ubuntu is the most famous from the Debian group, and the centOS is the most common from the Redhat group. Both of them are Linux operating system, but there are few differences in them.

What is the difference between Ubuntu and CentOS 7?

CentOS Ubuntu OS
CentOS is based on Redhat Enterprise Ltd. Ubuntu is based on Debian architecture
It barely updates the OS It frequently updates the OS.
They support cPanel They don’t support cPanel
It has a smaller user and developer It has a large user and developer
A lesser amount of help available A higher amount of help available
Hard to learn Easier to learn
.rpm packages installed using the yum package .deb packages installed using the apt-get

How to configure DNS Server on Ubuntu-Linux

To set DNS server in Ubuntu is almost similar to centOS seven we discussed. There are a few difference in coding, and we will see them step by step. Before you get into these steps, make sure you have your static IP. Open your terminal and start typing.

  1. Go to root access: Type “sudo su” and enter your password to get access in the root directory.
  2. Install bind9: Type “apt-get install bind9” to install the bind9. It is necessary for the DNS configuration.
  3. Check your hostname and IP: Type “nano /etc/hosts”, find the hostname and IP (Here we will be using
  4. Check the server lists: Type “nano /etc/resolve.conf” to check the lists.
  5. Edit the named.conf.local: Type “nano /etc/bind/named.conf.local” and type the following codes at the end. 
zone “” {
    type master;
    file “”;
codes at the end.  
zone “” {
    type master;
    file “”;

Create two files for forward and reverse DNS

  • Check the named file: Type “ls -1” to check if there is an error. Suppose you find loading 0 means no mistake. Further, check the following codes, “cd /etc/bind/”, “/etc/bind# las -1”. 
  • Create Now, we need to create those two files we mentioned in the codes. Type “cp db.local /var/cache/bind/” get inside. We first copied db.local, and then we renamed it as Now, type “nano /var/cache/bind/” to get inside. Edit the places we discussed below: 
@ IN NS 
www IN A Your static IP 
ftp IN A your static IP 
  • Create Type cp /var/cache/bind/ / var/cache/bind/ to create an file. Now type nano /var/cache/bind/ to open it. Edi the places we mentioned below.

@ IN NS 

Your reverse IP address (without last two digits)  IN PTR

  • Restart your bind9: Type /etc/bind /etc/init.d/bind9 restart. We have now done with the configuration.
  • Lookup: If you want to check what you have done, then type nslookup ( or IP or www or ftp)”.


It’s easy. Right? Just follow the serials, and we will get what you want to do. After all, we hope we could well explain the coding of the configuration.  If you face any difficulties, don’t forget to inform us. We will always be by your side. Stay with infolinux, and we promise quality contents here. See you in the next article.

Leave a Reply