Step By Step configuration of DNS server December 28, 2010 Posted by Wagema Samuel under Linux Note:- Before Start Set ip-address manually (I use 172.17.0.250) Set hostname FQDN (I use server.pdc.home) No need to install caching-nameserver if you are using fedora 9 to 14. The Installation has been performed on the following Linux OS. Server: Fedora 6 to 14, rhel 5.0, to 5.5 & Centos 5.0, to 5.5. Note: Please be careful about the firewall and selinux policies before continuing with the configuration. Disable the Firewall &Selinux or create rules. 1. Installation of DNS Server. view source print? 1 [root@linux8 ~]# yum install bind* caching-nameserver* 2.Make sure that the host names are set properly view source print? 1 [root@linux8 ~]# vi /etc/hosts 127.0.0.1 localhost.localdomainlocalhost ::1 localhost6.localdomain6 localhost6 172.17.0.250 server.pdc.home server #(ip address &fqdn) view source print? 1 [root@linux8 ~]# vi /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=server.pdc.home view source print?
1
[root@linux8 ~]# hostname server.pdc.home
3. DNS resolve entry view source print? 1 [root@linux8 ~]# vi /etc/resolv.conf searchserver.pdc.home nameserver 172.17.0.250 4. Do the following configuration to setup DNS properly. (a) view source print? 1 [root@linux8 ~]# vi /etc/named.conf options { directory “/var/named”; dump-file “/var/named/data/cache_dump.db”; statistics-file “/var/named/data/named_stats.txt”; memstatistics-file “/var/named/data/named_mem_stats.txt”; query-source port 53; }; zone “pdc.home” IN { type master; file “pdc.home.forward”; allow-update { none; }; }; zone “0.17.172.in-addr.arpa” IN { type master; file “pdc.home.reverse”; allow-update { none; }; }; (b) Create the zone file in the proper location and also create a reverse zone file. view source print? 1 [root@linux8 ~]# cd /var/named
2 3 4
[root@linux8 ~]#cplocalhost.zonepdc.home.forward [root@linux8 ~]#cpnamed.localpdc.home.reverse [root@linux8 ~]# vi pdc.home.forward
$TTL 86400 @ IN SOA server.pdc.home. root.server.pdc.home. ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN NS server.pdc.home. IN A 127.0.0.1 server IN A 172.17.0.250 view source print? 1 [root@linux8 ~]# vi pdc.home.reverse $TTL 86400 @ IN SOA server.pdc.home. root.server.pdc.home. ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS server.pdc.home. 250 IN PTR server.pdc.home. (c) Restart the named service view source print? 1 [root@linux8 ~]# service named restart 2 [root@linux8 ~]#chkconfig named on #for permanent service on 3 [root@linux8 ~]# bind-chroot-admin -d 4 [root@linux8 ~]# bind-chroot-admin -e #for binding with chroot Security The DNS Server is ready now, it’s time to test.