CentOS 6
Sponsored Link

Start BIND2014/08/02

[1] Start BIND to provides DNS service.
[root@dlp ~]#
/etc/rc.d/init.d/named start

Starting named:
[  OK  ]

[root@dlp ~]#
chkconfig named on

[2] If IPTables is running, allow DNS port. DNS uses 53/TCP,UDP.
For "-I INPUT 5" section below, Replace it to your own environment.
[root@dlp ~]#
iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT

[root@dlp ~]#
iptables -I INPUT 5 -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT

[3] Change settings that the server refer to local DNS service.
[root@dlp ~]#
vi /etc/sysconfig/network-scripts/ifcfg-eth0
# change to own host

DNS1=
10.0.0.30
[root@dlp ~]#
/etc/rc.d/init.d/network restart

[4] Make sure the server can resolve domain names or IP addresses.
[root@dlp ~]#
dig dlp.srv.world.
; <<>> DiG 9.7.0-P2-RedHat-9.7.0-5.P2.el6 <<>> dlp.srv.world.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7450
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;dlp.srv.world.
IN
A
;; ANSWER SECTION:
dlp.srv.world.
86400
IN
A
10.0.0.30  
# normally answered
;; AUTHORITY SECTION:
srv.world.
86400
IN
NS
dlp.srv.world.
;; Query time: 0 msec
;; SERVER: 10.0.0.30#53(10.0.0.30)
;; WHEN: Sun Jul 10 23:26:32 2011
;; MSG SIZE rcvd: 64
[root@dlp ~]#
dig -x 10.0.0.30
; <<>> DiG 9.7.0-P2-RedHat-9.7.0-5.P2.el6 <<>> -x 10.0.0.30
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14612
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;30.0.0.10.in-addr.arpa.
IN
PTR
;; ANSWER SECTION:
30.0.0.10.in-addr.arpa.
86400
IN
PTR
dlp.srv.world.  
# normally answered
;; AUTHORITY SECTION:
0.0.10.in-addr.arpa.
86400
IN
NS
dlp.srv.world.
;; ADDITIONAL SECTION:
dlp.srv.world.
86400
IN
A
10.0.0.30
;; Query time: 0 msec
;; SERVER: 10.0.0.30#53(10.0.0.30)
;; WHEN: Sun Jul 10 23:27:55 2011
;; MSG SIZE rcvd: 100
Matched Content