My SOHO lan is served by my main machine which operates as a router, firewall, gateway, DNS, DHCP server and backup server.

I've set up bind9 and isc-dhcp-server to do DDNS for the lan clients, while pppoe sets up the gateway to the net.

The backup server needs to recognise lan clients by hostname so I need it to look up their current IPs on the local DNS.

I'm using Ubuntu 16.04.4

I got quite far (see Dynamic DNS only serving DHCP clients, but new names not resolving on DNS server itself for the bind9 - dhcpd - ddns setup I did) but I still haven't managed to configure local DNS look-ups on the server.

The server's /etc/resolv.conf looks like this:

adam@gondor:~$ cat /etc/resolv.conf
domain localdomain
search localdomain

This is I assume being written at boot by pppoe which configures the gateway. There's a /etc/ppp/resolv.conf that is the same, but I'm not sure what role it plays.

My question is how I should configure linux so that backuppc will do DNS on the localhost for domain names on the lan, and yet browsing the net in firefox on the same machine will also work.

A colleague advised me to put in /etc/resolvconf/resolv.conf.d/head but that doesn't seem to be a good idea:

adam@gondor:~$ cat /etc/resolvconf/resolv.conf.d/head
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

I'm also not using network-manager to control pppoe which seems to be a popular choice.

[UPDATE After 1st comment] I looked more into the resolvconf package and discovered that it was out-of-date. I've updated it but I'm now pretty sure that the warning in head above is warning me not to edit resolv.conf manually, rather than /etc/resolvconf/resolv.conf.d/head.

It also didn't help that http://manpages.ubuntu.com/manpages/xenial/man8/resolvconf.8.html talks about files that resolvconf isn't giving me, like resolvconf.conf.

I have also decided that pppd can't be using resolvconf, so I have disabled it from updating /etc/resolv.conf by commenting out the updatedns option in /etc/ppp/peers/dsl-provider. I don't want the British Telecom DNS servers anyway, I'm going to configure resolvconf to use, and I'll tell bind9 to forward to the OpenDNS servers instead.

  • 1
    To my knowledge, for DNS queries to your server, the interface name server should be So, I would use that inside /etc/resolv.conf as nameserver instead of the two you listed. If your server needs to resolve names itself, it uses the forwarders set up in /etc/named.conf. – Phoenix Mar 24 '18 at 6:59

pppd was controlling /etc/resolv.conf so the first thing I had to do was take out the ppp option which told it to pass through the British Telecom DNS servers. That was in usepeerdns in /etc/ppp/peers/dsl-provider.

Then I purged and re-installed the resolvconf package out of frustration, and re-installing it actually set it up as it is documented (almost) at http://manpages.ubuntu.com/manpages/xenial/man8/resolvconf.8.html

I put nameserver in /etc/resolvconf/resolv.conf.d/head so now it appears in the /etc/resolv.conf or better said in the /run/resolvconf/resolv.conf file linked to.

I tweaked my /etc/bind/named.conf.options:

acl goodclients {

options {
        listen-on {
        listen-on-v6 {
        directory "/var/cache/bind";
        forwarders {
        allow-query { goodclients; };
        allow-recursion { goodclients; };
        allow-transfer { goodclients; };
        dnssec-enable no;
        #dnssec-validation auto;                                                                                                                                         
        auth-nxdomain no;    # conform to RFC1035                                                                                                                        

One article I was following told me to put in my acl goodclients block, and also to use dnssec-validation auto; but they caused a whole raft of errors to be logged in syslog so I took them out again.

It would also work without the forwarders block where I put the OpenDNS DNS servers, but without them, lots of IPv6 network unreachable errors.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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