How To Create Dns Server In Centos
To install and configure DNS server in CentOS 7
Domain Name System or DNS is a service that will resolve the host name for the particular IP address. When we search for a domain namely www.google.com in browser, the . (dot) seperating the domain name will search for the root server of namespace. Globally there are 13 root servers available to resolve the query. The DNS will lookup to a local resolver that contains an entry about the DNS server information, if there is no such record in local resolver, the search escalates to Top Level Domain (TLD), if there is no such record found, the search will escalate to the authoritative server. The browser will cache the DNS request for future uses. This is the work process of DNS server. This tutorial will explain the installation and configuration procedure of DNS server in CentOS 7.
Installation and Configuration procedure
To proceed with the installation procedure, install the bind package using the following command and press y to continue with the installation process.
[[email protected] ~]# yum install bind* -y BDB2053 Freeing read locks for locker 0x3c91: 2296/139663582197568 BDB2053 Freeing read locks for locker 0x3c93: 2296/139663582197568 Loaded plugins: fastestmirror, langpacks base | 3.6 kB 00:00 extras | 3.4 kB 00:00 updates | 3.4 kB 00:00 extras/7/x86_64/primary_db | 191 kB 00:00 Determining fastest mirrors * base: mirrors.nhanhoa.com . . bind-sdb-chroot.x86_64 32:9.9.4-50.el7_3.1 bind-utils.x86_64 32:9.9.4-50.el7_3.1 Complete!
Edit the Configuration file of the name server using vim editor. Add primary DNS server IP in listen on port 53 option. Enter IP range of hosts in the allow-query option and define forward and reverse lookup zone for the primary DNS server. Make the following changes and save it.
[[email protected] ~]# vi /etc/named.conf zone " linuxhelp11.com" IN { type master file " fwd.linuxhelp11" allow-update { none } } zone " 7.168.192.in-addr.arpa" IN { type master file " rev.linuxhelp11" allow-update { none } }
Enter into named directory by running the cd command as follows.
[[email protected] ~]# cd /var/named/
Create forward zone files using vim editor. Add the following lines to the file and save it.
[[email protected] named]# vim fwd.linuxhelp11 $TTL 86400 @ IN SOA ns1.linuxhelp11.com. root.linuxhelp11.com. ( 2011071001 Serial 3600 Refresh 1800 Retry 604800 Expire 86400 Minimum TTL ) @ IN NS ns1.linuxhelp11.com. @ IN A 192.168.7.236 ns1 IN A 192.168.7.236
Now create reverse zone files. Add the following lines to the file and save it.
[[email protected] named]# vim rev.linuxhelp11 Add the following lines to the file $TTL 86400 @ IN SOA ns1.linuxhelp11.com. root.linuxhelp11.com. ( 2011071001 Serial 3600 Refresh 1800 Retry 604800 Expire 86400 Minimum TTL ) @ IN NS ns1.linuxhelp11.com. ns1 IN A 192.168.7.236 236 IN PTR ns1.linuxhelp11.com.
Start the DNS service by executing the following command.
[[email protected] named]# systemctl start named.service
Next add port in the firewall and reload the firewall by running the following commands.
[[email protected] named]# firewall-cmd --permanent --add-port=53/tcp success [[email protected] named]# firewall-cmd --permanent --add-port=53/udp success [[email protected] named]# firewall-cmd --reload success
To check for errors in the configuration file and zone file execute the set of following commands. The configuration of DNS is now complete.
[[email protected] named]# named-checkconf /etc/named.conf [[email protected] named]# named-checkzone linuxhelp11.com /var/named/fwd.linuxhelp11 zone linuxhelp11.com/IN: loaded serial 2011071001 OK [[email protected] named]# named-checkzone linuxhelp11.com /var/named/rev.linuxhelp11 zone linuxhelp11.com/IN: loaded serial 2011071001 OK
To check the DNS service, give the DNS machine IP to client machine (here we are using windows machine as the client) and check for the IPv4 DNS server in network connection details.
Switch over to the browser and search for any sites like YouTube.
It will lead the browser page to Youtube without any glitches.
Another method to check the DNS is to open the command prompt in client machine and give the command nslookup google.com. It will show the output that the internet is working from our DNS by the client machine' s IP address.
The installation and configuration procedure of DNS server in CentOS 7 is done successfully.
How To Create Dns Server In Centos
Source: https://www.linuxhelp.com/how-to-install-and-configure-dns-server-in-centos-7
Posted by: baileylierearmeng.blogspot.com
0 Response to "How To Create Dns Server In Centos"
Post a Comment