Friday, June 22, 2012

Caching only dns server using Ubuntu Desktop 10.10

Here are the steps.

apt-get remove NetworkManager

nano /etc/network/interfaces

auto eth0
iface eth0 inet static
address   192.168.10.10
netmask   255.255.255.0
network   192.168.10.0
broadcast 192.168.10.255
gateway   192.168.10.201

/etc/init.d/networking restart

apt-get install bind9 dnsutils bind9-doc

nano /etc/bind/named.conf.local

forwarders{
                8.8.8.8;
                4.2.2.2;
                8.8.4.4;
         };

        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
};

nano /etc/bind/named.conf.local

#Forward Lookup Zone
zone "sourav.com" {
type master;
file "/etc/bind/db.sourav.com";

};
#Reverse Lookup Zone

zone "10.168.192.in-addr.arpa"

{
type master;
notify no;
file "/etc/bind/db.192";

};

nano /etc/bind/db.sourav.com

;
; BIND data file for local loopback interface
;
$TTL    604800
@    IN    SOA    souravubuntu.sourav.com. sourav.localhost. (
                  2        ; Serial
             604800        ; Refresh
              86400        ; Retry
            2419200        ; Expire
             604800 )    ; Negative Cache TTL
;
@    IN    NS    souravubuntu.sourav.com.
@    IN    A    127.0.0.1
@    IN    AAAA    ::1
;Below are A Record Addresses

itguru       IN      A        192.168.10.201
souravubuntu IN      A        192.168.10.10
client       IN      A        192.168.10.101

;  


server1      IN      CNAME     souravubuntu.sourav.com.
gw           IN      CNAME     itguru.sourav.com.

   

nano /etc/bind/db.192

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@    IN    SOA    souravubuntu.sourav.com. sourav.localhost. (
                  1        ; Serial
             604800        ; Refresh
              86400        ; Retry
            2419200        ; Expire
             604800 )    ; Negative Cache TTL
;
@    IN    NS    souravubuntu.sourav.com.
10      IN      PTR     souravubuntu.sourav.com.
201     IN      PTR     itguru.sourav.com.
101      IN      PTR     client.sourav.com.
  
nano /etc/resolv.conf

nameserver 192.168.10.10
domain sourav.com
search sourav.com

nano /etc/hosts


127.0.0.1    souravubuntu   localhost.localdomain    localhost
127.0.1.1    souravubuntu

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

/etc/init.d/bind9 restart

Help:http://mixeduperic.com/ubuntu/seven-easy-steps-to-setting-up-an-interal-dns-server-on-ubuntu.html


No comments:

Post a Comment