Configure DNS Server in Linux Centos 7

What is DNS ?

Domain Name Service (DNS) is an internet service that maps IP addresses to fully qualified domain names (FQDN) and vice versa.

BIND stands for Berkley Internet Naming Daemon.

BIND is the most common program used for maintaining a name server on Linux.

In this post, we will explain how to install and configure a DNS server.

Scenario :

DNS server hostnamehttp://www.server.world

Linux Client 1 Host name – dlp.servet.world

Linux Client 2 Host name – exm.server.world

IP – 192.168..0.101

Required Package on server – bind, bind-utils

Server Configuration – Install Bind to configure DNS which resolve domain name or IP address.

Step 1 : Install required packages to configure DNS

[#] yum -y install bind bind-utils

1.PNG

Please use your own ip address and domain name when you configure your own server

Step 2 : BIND’s configuration consists of multiple files, which are included from the main configuration file, named.conf. These filenames begin with “named” because that is the name of the process that BIND runs. We will start with configuring the options file.

1.PNG

1.PNG

Note : Below screen shot are the main entries which we have change in the above named.conf file.

2.PNG

2.PNG

2

2.PNG

Now save and exit named.conf. The above configuration specifies that only your own servers (the “trusted” ones) will be able to query your DNS server.

Next, we will create and configure the forward and reverse file, to specify our DNS zones.

Step 3 : Now we will create zone file that server resolve IP addresses from domain names.

Firstly we will create a forward file :

[#] vi /var/named/fwd.unix

1

1.PNGSecond we will create the reverse file

[#] vi /var/named/rev.unix

1.PNG

Step 4 : Now we enter the server ip address in the resolve.conf file to IP to name or name to IP resolution

[#] vi /etc/resolve.conf

1

1

Step 5 : After creating forward and reverse file we need to start  and enable the named services

[#] systemctl start named

[#] systemctl enable named

1

Step 6 : Now we start the client configuration , first we enter the client hostname and ip address in the server forward and reverse file to resolve.

Now we open forward file on the DNS server and enter the client host name and ip address.

[#] vi /var/named/fwd.unix

1.PNG

1.PNG

Now we open reverse file on the DNS server and enter the client host name and ip address.

[#] vi /var/named/rev.unix

1

1.PNG

Linux Client Configuration :

Step 1 : Open Client 1 and open the resolve.conf file

[#] vi /etc/resolv.conf

1.PNG

In this file we will mention the name server and its IP address, in our case the name server and its IP address is 192.168.0.101

1.PNG

Step 2 : Now we will check our configuration on Client 1 is completed or not.

1

1.PNG

1.PNG

Note : By using dig command if we get all values are one then our client configuration is correct.

Step 3 : Open Client 2 and open the resolve.conf file

[#] vi /etc/resolv.conf

1.PNG

In this file we will mention the name server and its IP address, in our case the name server and its IP address is 192.168.0.101

1

Step 4 : Now we will check our configuration on Client 1 is completed or not.

1.PNG

1.PNGNote : By using dig command if we get all values are one then our client configuration is correct.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DNS Server Configured Successfully !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s