To install Bind9 on ubuntu enter the command
apt-get install bind9 dnsutils
After the bind9 installed succesfully change the Directory to /etc/bind
cd /etc/bind
list content of the /etc/bind directory
ls -l
Open named.conf.local to define the new Zone information
nano named.conf.local
For the demostration rukspot.com taken as domain name and use 10.0.2.15 as ethernet interface address.
To see the interface addres enter the ifconfig eth0 or approproate interface
ifconfig eth0
Add the new Zone information as below
zone "rukspot.com" { type master; file "/etc/bind/db.rukspot"; }; zone "2.0.10.in-addr.arpa" { type master; file "/etc/bind/db.10"; };
Now create the db.rukspot and db.10 files.
Enter below command to copy and create new file using exesting files
cp db.local db.rukspot cp db.127 db.10
Then open the db.rukspot
nano db.rukspot
Enter the db.rukspot records
; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA ns.rukspot.com. root.rukspot.com. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS ns.rukspot.com. @ IN A 10.0.2.15 ns IN A 10.0.2.15 IN MX 10 mail.rukspot.com. www IN CNAME ns mail IN CNAME ns
open the db.10
nano db.10
Enter the db.10 records
; ; BIND reverse data file for local loopback interface ; $TTL 604800 @ IN SOA ns.rukspot.com. root.rukspot.com. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS ns.rukspot.com. 1 IN PTR ns.rukspot.com. 2 IN PTR ns.rukspot.com. 5 IN PTR ns.rukspot.com. 15 IN PTR ns.rukspot.com.
Now restart the DNS service and bind9 entering this command
invoke-rc.d bind9 restart
Then check the DNS working correctly
Enter nslookup rukspot.com
nslookup rukspot.com
If you get this kind of response forward lookup zone is working
root@rukshan-VirtualBox:/etc/bind# nslookup mail.rukspot.com Server: 127.0.0.1 Address: 127.0.0.1#53 mail.rukspot.com canonical name = ns.rukspot.com. Name: ns.rukspot.com Address: 10.0.2.15
Then enter nslookup 10.0.2.15
nslookup 10.0.2.15
If you get this kind of response reverse lookup zone is working
root@rukshan-VirtualBox:/etc/bind# nslookup 10.0.2.15 Server: 127.0.0.1 Address: 127.0.0.1#53 15.2.0.10.in-addr.arpa name = ns.rukspot.com.
To see the debug information type dig mail.rukspot.com
dig mail.rukspot.com
Output should be similar to this.
root@rukshan-VirtualBox:/etc/bind# dig mail.rukspot.com ; <<>> DiG 9.8.1-P1 <<>> mail.rukspot.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22206 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;mail.rukspot.com. IN A ;; ANSWER SECTION: mail.rukspot.com. 604800 IN CNAME ns.rukspot.com. ns.rukspot.com. 604800 IN A 10.0.2.15 ;; AUTHORITY SECTION: rukspot.com. 604800 IN NS ns.rukspot.com. ;; Query time: 1 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Wed Nov 19 10:11:40 2014 ;; MSG SIZE rcvd: 81
Now DNS is working correctly.
Add Comment
Comments (0)