I've been working on setting up a bind9 server on my home server running Ubuntu Server 16.04 to allow me to access my services by name rather than an IP address.

The bind server itself is (mostly) set up and working perfectly. I can resolve hostnames from ip addresses and ip addresses from hostnames from my network devices, but the server itself can't resolve anything from its own bind9 records and it's leaving me a little bit stumped.

The only nameservers in /etc/resolv.conf are my router and

These are setup in my /etc/network/interfaces. I'm assuming my problem is that isn't in there, so the server itself is immediately looking to my router to resolve addresses and then to but when I add to /etc/network/interfaces then nothing else gets added to /etc/resolv.conf so I'm left with a single name server of

I do have forwarders set up in /etc/bind/named.conf.local, and they do work in that I can still access the internet, but from every guide I've read, bind9 should be adding to /etc/resolv.conf itself meaning it's still also populated by the servers in my /etc/network/interfaces file so that my server is still "online" even if the bind server fails for some reason.

I've checked /etc/default/bind9 and RESOLVCONF=yes is there

# run resolvconf?

# startup options for the server
OPTIONS="-u bind"

Here's my /etc/network/interfaces in case something is wrong there


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo wlan0
iface lo inet loopback

# The primary network interface

#auto eth0
#       iface eth0 inet static

iface wlan0 inet static
        wpa-ssid #############
        wpa-psk ****************
#       mtu 1500

Here's my /etc/bind/named.conf

acl mynetwork {;
// This is the primary configuration file for the BIND DNS server named.
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
key rndc-key {
        algorithm hmac-md5;
        secret "*****************";
controls {
        inet port 953 allow {; } keys { rndc-key; };

And my /etc/bind/named.conf.options

options {
        directory "/var/cache/bind";

        // If there is a firewall between you and nameservers you want
        // to talk to, you may need to fix the firewall to allow multiple
        // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

        forwarders {

        // If BIND logs error messages about the root key being expired,
        // you will need to update your keys.  See https://www.isc.org/bind-keys
        dnssec-validation auto;

        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
        forward first;

If you need to see any of the zone files please ask, but I don't think they're the problem since name resolution works fine from other devices, just not from the server itself; unless I change my /etc/network/interfaces file and have as my only dns server in /etc/resolv.conf so I guess this was a long winded way of me asking How do I add to my list of dns in /etc/resolv.conf instead of having it as the only entry


I've found a solution (of sorts) to this myself.

I edited my /etc/resolvconf/head file and added the line nameserver and put my /etc/network/interfaces nameserver section back to normal. I now have as the first entry in my /etc/resolv.conf followed by the nameservers listed in my /etc/network/interfaces

I still don't know why bind wasn't adding the entry itself, but at least everything is now working.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.