How to Install DNS Server in CentOS/RHEL 6x
Note: Before Start
Set ip-address manually (I use 192.168.72.140)
Set hostname FQDN (I use server1.domain.com)
Step: 1. To set IP-Address :
# system-config-network-tui
Uncheck DHCP & Give the IP Address manually.
OK -> Quit
Step: 2. Installation of DNS Server :
# yum -y install bind* caching-nameserver
Step: 3. Make sure that the Host Names are set Properly :
# vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.72.140 server1.domain.com server1 (IP Address & FQDN)
-- Save & Quit (:wq)
# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=server1.domain.com
-- Save & Quit (:wq)
Step: 4. Set Hostname :
# hostname server1.domain.com
Step: 5. DNS resolve Entry :
# vi /etc/resolv.conf
search domain.com
nameserver 192.168.10.1
-- Save & Quit (:wq)
Step: 6. Configure DNS Server :
# vi /etc/named.conf
Edit those Lines :
options {
listen-on port 53 { 192.168.72.140; };
# listen-on-v6 port 53 { ::1; };
allow-query { any; };
Add Those Lines :
zone"domain.com" IN {
type master;
file "forward.zone";
allow-update { none; };
};
zone"72.168.192.in-addr.arpa" IN {
type master;
file "reverse.zone";
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
-- Save & Quit (:wq)
Note: Create forward and reverse zone files which we mentioned in the ‘/etc/named.conf’ file.
Step: 7. Create Forward Zone :
# vi /var/named/forward.zone
$TTL 86400
@ IN SOA server1.domain.com. root.server1.domain.com. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
IN NS server1.domain.com.
server1 IN A 192.168.72.140
-- Save & Quit (:wq)
Step: 8. Create Reverse Zone :
# vi /var/named/reverse.zone
$TTL 86400
@ IN SOA server1.domain.com. root.server1.domain.com. (
2011071001 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
IN NS server1.domain.com.
140 IN PTR server1.domain.com.
-- Save & Quit (:wq)
Step: 9. Now Change Group of forward.zone & reverse.zone :
# cd /var/named/
# chgrp named forward.zone
# chgrp named reverse.zone
Step: 10. Restart the named Service :
Note: FIXING THE BIND (NAMED) SERVICE BUG – GENERATING /ETC/RNDC.KEY
# rndc-confgen -a -r /dev/urandom
# service named restart
# chkconfig named on
Step: 11. The DNS Server is ready now, 9. it’s time to Test :
# dig server1.domain.com
# dig -x 192.168.72.140
# nslookup
> sever1.domain.com
> 192.168.72.140
Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog
0 comments:
Post a Comment