Ubuntu Bind9 set up and resolv.conf
The tutorial you refer to is outdated insofar as it tells you to edit /etc/resolv.conf by hand. In Ubuntu 12.04 and later you don't edit /etc/resolv.conf by hand but configure resolvconf to put the correct content in that file. If you have followed the other steps in the tutorial and want to use the locally running BIND 9 named to resolve DNS names then the right thing to do is (1) make sure that /etc/resolv.conf is (still) a symbolic link to ../run/resolvconf/resolv.conf
and (2) set RESOLVCONF=yes
in /etc/default/bind9 to cause BIND 9 named to register its local listen address 127.0.0.1 with resolvconf when it starts; (3) do /etc/init.d/bind9 restart
.
If you would like to add search domain names to the resolver configuration then add a dns-search
line to the iface lo
stanza in /etc/network/interfaces.
iface lo inet loopback
dns-search name1 name2
After doing this you have to ifdown lo
and ifup lo
to cause the information to be added to resolv.conf.
Related videos on Youtube
Mario
Updated on September 18, 2022Comments
-
Mario over 1 year
I found this tutorial the best I've come across and it works! Well done although I can't vote and comment on it due to my site privilege as yet.
How do I do a complete BIND9 DNS Server Configuration with a hostname?
My question is, I'm unsure about the resolv.conf file, where the tutorial states to insert the nameserver, domain and search. My resolv.conf file has a comment above it saying "do not edit this file by hand - your changes will be overwritten". Can anyone clarify this for me please?
Thanks in advance, Mario.
-
Rinzwind over 10 yearsHere is how to do it: askubuntu.com/questions/130452/… See the 1st answer and last comment 1st answer.
-
-
Master James about 5 yearsIn Ubuntu 19.04 /etc/network/interfaces is not found.