INTRODUCTION
In this tutorial we will configure DNS server on RHEL7. Bind package is use for DNS server installation. In this tutorial will show you how to configure simple DNS server as well as Master-slave DNS server configuration.
Important Terminology
There are some important keyword use in DNS server configuration. I will explain that keywords in simple word.
1) DNSSEC (Domain name system security extensions):
DNSSEC adds a resource records and message header bits which can be used to verify that the requested data matches what the zone admin in the zone and not been altered in the transit.
2) bind.keys file :
It contains the root key and the DLV key.
Installation
1) For installing DNS server on RHEL 7 use bellow command
~]# yum install -y bind bind-utils
Main configuration file for DNS configuration is /etc/named.conf. We will edit some options in this file.
~]# vi /etc/named.conf
listen-on port 53 { any; };
By default it contains localhost or 127.0.0.1 changing it to any we can query from other systems too.
To allow query on DNS server from any systems use bellow command:
allow-query { any; };
Add bellow line to forward queries through your ISP IP replace IP with your ISP's IP for forwarding queries.
forward only; forwarders { 192.168.1.10; };
Adding zone file details in named.conf
~] systemctl start named;
Verify DNS service is running on port 53 using netstat.
~] netstat -antp | grep -w 53
Next, step is to create Zone file for example.com domain.
i) After adding new records or updating zone file its good practice to change last 2 digits of the serial number. If you not change them then no changes will be reflected even after restarting named service.
ii) IN NS indicates the name server.
iii) IN mx indicates mx records of the mail server.
Creating reverse zone file:
Checking configuration file.
~] named-checkconf
Checking zone configuration file.
~] named-checkzone example.com /var/named/example.com.zone
~] systemctl restart named; systemctl enable named
Test the DNS server configuration:
~] dig @192.168.1.10 www.example.com
where 192.168.1.10 is the ip of the local server on which we have configure Dns server.
In next, tutorial will show you how to fine tune DNS server.
Comments
Post a Comment