How to setup DNS 1. install sudo apt-get install bind9 sudo apt-get install dnsutils 2. configuration (caching name server or primary master or secondary master) a) Caching Nameserver a.1) simply uncomment and Replace x.x.x.x with the IP Adresses of your ISP's DNS servers sudo nano /etc/bind/named.conf.options forwarders { 207.69.188.185; 207.69.188.187; }; a.2) sudo /etc/init.d/bind9 restart b) Primary Master b.1) add a DNS zone to BIND9, turning BIND9 into a Primary Master server sudo nano /etc/bind/named.conf.local zone "icc-computer.com" { type master; file "/etc/bind/db.icc-computer.com"; }; b.2) create the /etc/bind/db.icc-computer.com by an existing zone file as a template sudo cp /etc/bind/db.local /etc/bind/db.icc-computer.com b.3) Edit the new zone file as below (Note: You must increment the Serial Number every time you make changes to the zone file.) sudo nano /etc/bind/db.icc-computer.com ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA localhost. root.icc-computer.com. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS ns1.icc-computer.com. @ IN A 192.168.1.100 @ IN AAAA ::1 ns1 IN A 192.168.1.100 ns2 IN A 192.168.1.101 ubuntu9 IN A 192.168.1.100 Server2003 IN A 192.168.1.101 smtp IN A 192.168.1.100 b.4) Edit Reverse Zone File sudo nano /etc/bind/named.conf.local zone "1.168.192.in-addr.arpa" { type master; notify no; file "/etc/bind/db.192"; }; b.5) create the /etc/bind/db.192 file sudo cp /etc/bind/db.127 /etc/bind/db.192 b.7) edit /etc/bind/db.192 (as below) sudo nano /etc/bind/db.192 ; BIND reverse data file for local loopback interface ; $TTL 604800 @ IN SOA ns1.icc-computer.com. root.icc-computer.com. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS ns1. 100 IN PTR ns1.icc-computer.com. @ IN NS ns2. 101 IN PTR ns2.icc-computer.com. 100 IN PTR ubuntu9.icc-computer.com. 101 IN PTR Server2003.icc-computer.com. 100 IN PTR smtp.icc-computer.com. b.8) sudo /etc/init.d/bind9 restart c) Secondary Master c.1) Add the allow-transfer (as below) sudo nano /etc/bind/named.conf.local zone "icc-computer.com" { type master; file "/etc/bind/db.icc-computer.com"; allow-transfer { 192.168.1.101; }; }; zone "1.168.192.in-addr.arpa" { type master; notify no; file "/etc/bind/db.192"; allow-transfer { 192.168.1.101; }; }; 3. test dig -x 127.0.0.1 dig ubuntu.com dig ubuntu.com #again to see the Query time improvement ping icc-computer.com named-checkzone icc-computer.com /etc/bind/db.icc-computer.com named-checkzone icc-computer.com /etc/bind/db.192