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 example.com)
  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 “example.com” {
    type master;
    file “forward.example.com”;
};
codes at the end.  
zone “172.in-addrpa” {
    type master;
    file “reverse.example.com”;
};

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 forward.example.com: Now, we need to create those two files we mentioned in the codes. Type “cp db.local /var/cache/bind/forward.example.com” get inside. We first copied db.local, and then we renamed it as forward.example.com. Now, type “nano /var/cache/bind/forward.example.com” to get inside. Edit the places we discussed below: 
server.example.com. root.example.com. 
..
@ IN NS example.com 
www IN A Your static IP 
ftp IN A your static IP 
  • Create reverse.example.com: Type cp /var/cache/bind/forward.example.com / var/cache/bind/reverse.example.com to create an reverse.example.com file. Now type nano /var/cache/bind/reverse.example.com to open it. Edi the places we mentioned below.

@ IN NS example.com 

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

  • 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 example.com ( or IP or www or ftp)”.

Summery

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