Example Domain: mydomain.com
foo@bar:~$ apt-get install bind9
foo@bar:~$ cd /etc/bind
Open file named.conf.local
foo@bar:/etc/bind$ nano named.conf.local
Add lines
zone "mydomain.com" IN {
type master;
file "/etc/bind/zones/mydomain.com.zone";
};
Create folder and copy the example file
foo@bar:/etc/bind$ mkdir zones
foo@bar:/etc/bind$ cp db.local zones/mydomain.com.zone
Open your new file and replace localhost
foo@bar:/etc/bind$ nano zones/mydomain.com.zone
; ; BIND data file for local loopback interface ; $TTL 604800 @ IN SOA mydomain.com. root.mydomain.com. ( 2 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS mydomain.com. @ IN A 127.0.0.1 @ IN AAAA ::1
Restart bind9
foo@bar:/etc/bind$ service bind9 restart