network-environment: 192.168.1.0/24 - home lan network 192.168.1.100 - router 192.168.1.251 - raspberry rpi-dns - hostname of the raspberry 208.67.220.220, 208.67.222.222 - opendns let´s start Code: sudo su apt-get install bind9 Code: cd /etc/bind nano /etc/bind/db.home.lan content: Code: ; Use semicolons to add comments. ; Host-to-IP Address DNS Pointers for home.lan ; Note: The extra "." at the end of the domain names are important. ; The following parameters set when DNS records will expire, etc. ; Importantly, the serial number must always be iterated upward to prevent ; undesirable consequences. A good format to use is YYYYMMDDII where ; the II index is in case you make more that one change in the same day. home.lan. IN SOA raspberry.home.lan. hostmaster.home.lan. ( 2015120101 ; serial 8H ; refresh 4H ; retry 4W ; expire 1D ; minimum ) ; NS indicates that raspberry is the name server on home.lan ; MX indicates that raspberry is (also) the mail server on home.lan home.lan. IN NS rpi-dns.home.lan. home.lan. IN MX 10 rpi-dns.home.lan. ; Set the address for localhost.home.lan localhost IN A 127.0.0.1 ; Set the hostnames in alphabetical order rpi-dns IN A 192.168.1.251 router IN A 192.168.1.100 Spoiler: click for more... Register or Login to view Spoiler content!
u can also enter the address of your router (192.168.1.100) because he always refers to the current ip dns server of your provider's Code: nano /etc/bind/named.conf.options Code: forwarders { 192.168.1.100; };