How do I configure my DNS / DHCP / gateway server with 2 NICs to use its own DNS?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite
1












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
nameserver 81.139.56.100
nameserver 81.139.57.100
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 127.0.0.1 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)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN


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 127.0.0.1, and I'll tell bind9 to forward to the OpenDNS servers instead.







share|improve this question


















  • 1




    To my knowledge, for DNS queries to your server, the interface name server should be 127.0.0.1. 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 at 6:59














up vote
1
down vote

favorite
1












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
nameserver 81.139.56.100
nameserver 81.139.57.100
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 127.0.0.1 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)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN


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 127.0.0.1, and I'll tell bind9 to forward to the OpenDNS servers instead.







share|improve this question


















  • 1




    To my knowledge, for DNS queries to your server, the interface name server should be 127.0.0.1. 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 at 6:59












up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





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
nameserver 81.139.56.100
nameserver 81.139.57.100
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 127.0.0.1 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)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN


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 127.0.0.1, and I'll tell bind9 to forward to the OpenDNS servers instead.







share|improve this question














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
nameserver 81.139.56.100
nameserver 81.139.57.100
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 127.0.0.1 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)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN


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 127.0.0.1, and I'll tell bind9 to forward to the OpenDNS servers instead.









share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 12:43

























asked Mar 23 at 23:44









Adam

1186




1186







  • 1




    To my knowledge, for DNS queries to your server, the interface name server should be 127.0.0.1. 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 at 6:59












  • 1




    To my knowledge, for DNS queries to your server, the interface name server should be 127.0.0.1. 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 at 6:59







1




1




To my knowledge, for DNS queries to your server, the interface name server should be 127.0.0.1. 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 at 6:59




To my knowledge, for DNS queries to your server, the interface name server should be 127.0.0.1. 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 at 6:59










1 Answer
1






active

oldest

votes

















up vote
0
down vote













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 127.0.0.1 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 
localhost;
localnets;
;

options
listen-on
192.168.0.3;
127.0.0.1;
;
listen-on-v6
fe80::2a37:37ff:fe03:4225/64;
::1;
#any;
;
directory "/var/cache/bind";
forwarders
208.67.220.220;
208.67.222.222;
;
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 192.168.0.0/24 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.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f433177%2fhow-do-i-configure-my-dns-dhcp-gateway-server-with-2-nics-to-use-its-own-dns%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    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 127.0.0.1 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 
    localhost;
    localnets;
    ;

    options
    listen-on
    192.168.0.3;
    127.0.0.1;
    ;
    listen-on-v6
    fe80::2a37:37ff:fe03:4225/64;
    ::1;
    #any;
    ;
    directory "/var/cache/bind";
    forwarders
    208.67.220.220;
    208.67.222.222;
    ;
    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 192.168.0.0/24 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.






    share|improve this answer
























      up vote
      0
      down vote













      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 127.0.0.1 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 
      localhost;
      localnets;
      ;

      options
      listen-on
      192.168.0.3;
      127.0.0.1;
      ;
      listen-on-v6
      fe80::2a37:37ff:fe03:4225/64;
      ::1;
      #any;
      ;
      directory "/var/cache/bind";
      forwarders
      208.67.220.220;
      208.67.222.222;
      ;
      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 192.168.0.0/24 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.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        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 127.0.0.1 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 
        localhost;
        localnets;
        ;

        options
        listen-on
        192.168.0.3;
        127.0.0.1;
        ;
        listen-on-v6
        fe80::2a37:37ff:fe03:4225/64;
        ::1;
        #any;
        ;
        directory "/var/cache/bind";
        forwarders
        208.67.220.220;
        208.67.222.222;
        ;
        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 192.168.0.0/24 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.






        share|improve this answer












        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 127.0.0.1 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 
        localhost;
        localnets;
        ;

        options
        listen-on
        192.168.0.3;
        127.0.0.1;
        ;
        listen-on-v6
        fe80::2a37:37ff:fe03:4225/64;
        ::1;
        #any;
        ;
        directory "/var/cache/bind";
        forwarders
        208.67.220.220;
        208.67.222.222;
        ;
        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 192.168.0.0/24 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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 24 at 23:51









        Adam

        1186




        1186






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f433177%2fhow-do-i-configure-my-dns-dhcp-gateway-server-with-2-nics-to-use-its-own-dns%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?