Using Ubuntu, what are the commands for the following:
1. Install Bind9 :
ehowstuff@ehowstuff:~$ sudo apt-get install bind9 -y
2. Setup and configure zone with the name of ehowstuff.local
ehowstuff@ehowstuff:~$ sudo vim /etc/bind/named.conf.local
Add a DNS zone to BIND9. Edit named.conf.local as below :
//include "/etc/bind/zones.rfc1918";
zone "ehowstuff.local" {
type master;
file "/etc/bind/db.ehowstuff.local";
};
~
3. Copy and Use an existing zone file as a template:
ehowstuff@ehowstuff:/etc/bind$ sudo cp /etc/bind/db.local /etc/bind/db.ehow
Edit the new zone file db.ehowstuff.local.
ehowstuff@ehowstuff:~$ sudo vim /etc/bind/db.ehowstuff.local
Change configuration as below :
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.ehowstuff.local. root.ehowstuff.local. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.ehowstuff.local.
ns IN A 192.168.1.49
box IN A 192.168.1.49
4. Any changes that you’ve made to the zone file BIND9 will need to be restarted before it to take effect:
ehowstuff@ehowstuff:~$ sudo /etc/init.d/bind9 restart
* Stopping domain name service... bind9 [ OK ]
* Starting domain name service... bind9 [ OK ]
5. Make sure you own workstation or server pointing to dns server. In this case, this Ubuntu server pointed to itself since it’s running bind9.
ehowstuff@ehowstuff:~$ sudo vim /etc/resolv.conf
nameserver 127.0.0.1
6. Test bind9 server :
ehowstuff@ehowstuff:~$ nslookup
> set type=ns
> ehowstuff.local
Server: 127.0.0.1
Address: 127.0.0.1#53
ehowstuff.local nameserver = ns.ehowstuff.local.
ehowstuff.local nameserver = ns.ehowstuff.local.
Get Answers For Free
Most questions answered within 1 hours.