Monday, June 22, 2015

Configuring BIND DNS

Below is the topology:
 
     
 
Below is the configuratoin for DNS proxy:
 
#/etc/named.conf
options {
      directory "/var/named";
 
      dump-file               "data/cache_dump.db";
      statistics-file         "data/named_stats.txt";
      memstatistics-file      "data/named_mem_stats.txt";
 
 
      listen-on { 2.2.2.2; };
 
      forwarders {
       72.163.128.140;
      };
      forward only;
 
};
 
[root@lab ~]# service named restart
Stopping named: .                                          [  OK  ]
Starting named:                                            [  OK  ]
[root@lab ~]#
[root@lab ~]#
[root@lab ~]#
Next enter the following three commands to disable firewall.
# service iptables save
# service iptables stop
# chkconfig iptables off
 
Use below command to check if we are listening on UDP port 53 (DNS)
 
[root@lab ~]# netstat -a | grep domain
tcp        0      0 ARennes-651-1-107-2.:domain *:*                         LISTEN     
tcp        0      0 10.104.99.84:domain         *:*                         LISTEN     
tcp        0      0 lab:domain                  *:*                         LISTEN     
tcp        0      0 localhost6.localdomain:rndc *:*                         LISTEN     
udp        0      0 ARennes-651-1-107-2.w:domain *:*                                   
udp        0      0 10.104.99.84:domain         *:*                                    
udp        0      0 lab:domain                  *:*                                    
udp        0      0 localhost6.localdomain6:ntp *:*                                    
Active UNIX domain sockets (servers and established)
[root@lab ~]#
 
Use below command to restart DNS:
[root@lab ~]#
 
 
Use below command to check if the DNS proxy is working:
 
[root@lab ~]# dig @2.2.2.2 www.yahoo.com
 
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5_8.6 <<>> @2.2.2.2 www.yahoo.com
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53851
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 4, ADDITIONAL: 4
 
;; QUESTION SECTION:
;www.yahoo.com.                 IN      A
 
;; ANSWER SECTION:
www.yahoo.com.          174     IN      CNAME   fd-fp3.wg1.b.yahoo.com.
fd-fp3.wg1.b.yahoo.com. 174     IN      CNAME   ds-fp3.wg1.b.yahoo.com.
ds-fp3.wg1.b.yahoo.com. 51      IN      CNAME   ds-sg-fp3-lfb.wg1.b.yahoo.com.
ds-sg-fp3-lfb.wg1.b.yahoo.com. 291 IN   CNAME   ds-sg-fp3.wg1.b.yahoo.com.
ds-sg-fp3.wg1.b.yahoo.com. 43   IN      A       106.10.139.246
 
;; AUTHORITY SECTION:
wg1.b.yahoo.com.        9566    IN      NS      yf2.yahoo.com.
wg1.b.yahoo.com.        9566    IN      NS      yf3.a1.b.yahoo.net.
wg1.b.yahoo.com.        9566    IN      NS      yf4.a1.b.yahoo.net.
wg1.b.yahoo.com.        9566    IN      NS      yf1.yahoo.com.
 
;; ADDITIONAL SECTION:
yf1.yahoo.com.          28632   IN      A       68.142.254.15
yf2.yahoo.com.          9404    IN      A       68.180.130.15
yf3.a1.b.yahoo.net.     9433    IN      A       203.84.209.160
yf4.a1.b.yahoo.net.     9432    IN      A       124.108.77.128
 
;; Query time: 2 msec
;; SERVER: 2.2.2.2#53(2.2.2.2)
;; WHEN: Wed Sep 25 20:25:14 2013
;; MSG SIZE  rcvd: 297
 
[root@lab ~]#

No comments:

Post a Comment