OpenVPN, resolvconf, and DNS domain resolutionDNS resolution problem with OpenBSDHow to force nm-tool to...

Is there an idiom that means "revealing a secret unintentionally"?

What's an appropriate age to involve kids in life changing decisions?

Can you turn a recording upside-down?

How can it be that ssh somename works, while nslookup somename does not?

How to avoid making self and former employee look bad when reporting on fixing former employee's work?

When do you stop "pushing" a book?

if i accidentally leaked my schools ip address and someone d doses my school am i at fault

Publishing an article in a journal without a related degree

Are wands in any sort of book going to be too much like Harry Potter?

Why do the Avengers care about returning these items in Endgame?

How does weapons training transfer to empty hand?

Company stopped paying my salary. What are my options?

Two (probably) equal real numbers which are not proved to be equal?

What replaces x86 intrinsics for C when Apple ditches Intel CPUs for their own chips?

Can the president of the United States be guilty of insider trading?

What happens when the drag force exceeds the weight of an object falling into earth?

Examples where existence is harder than evaluation

Can a planet still function with a damaged moon?

How likely are Coriolis-effect-based quirks to develop in starship crew members?

Why is it wrong to *implement* myself a known, published, widely believed to be secure crypto algorithm?

How did Captain Marvel know where to find these characters?

Thawing Glaciers return to hand interaction

Has there been evidence of any other gods?

resoldering copper waste pipe



OpenVPN, resolvconf, and DNS domain resolution


DNS resolution problem with OpenBSDHow to force nm-tool to update its DNS serversopenwrt: can't change dns server setting in order to resolve non FQDN hostnamescan ping google dns, but not google.de -> unknown host // worked in another networkCan not set static DNS on debiandnsmasq & systemd Causing Intermittent CPU SpikesDefault DNS server settingsHow to make name server address permanent in /etc/resolv.conf even after system reboot?How to update resolv.conf?How do I get DNSMasq to serve up DNS to Windows hosts without a domain?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







7















While at site1, I need to connect to site2 via OpenVPN. Once connected, the OpenVPN site2 pushes a DNS nameserver and domain search options. This causes all name resolutions for site1 to fail.



Example:





  1. Physically connected at site1, DHCP pushes DNS options and resolvconf manages them.

    /etc/resolv.conf



    # 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
    nameserver 172.16.1.101
    nameserver 172.16.1.102
    search site1.internal.domain



  2. Open OpenVPN tunnel to site2, OpenVPN pushes dhcp-option DNS and DOMAIN for site2 and /etc/openvpn/update-resolv-conf pushes them to resolvconf.

    /etc/resolv.conf



    # 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
    nameserver 192.168.1.5
    nameserver 172.16.1.101
    nameserver 172.16.1.102
    search site2.internal.domain site1.internal.domain


  3. DNS resolution works for server.site2.internal.domain but fails for server.site1.internal.domain



Is there a way that any failed DNS request to site21 should fall-through to the site1 DNS servers? Or configure resolvconf that only queries for site2.internal.domain should be passed to the site2 nameserver?



I use an Ubuntu 14.04 machine at site1, and the OpenVPN server at site2 is a pfSense 2.2 box. I manage both sites so making changes to either side isn't a problem. Both domains are non-public and internal use only.










share|improve this question























  • I should add that although the laptop is Ubuntu 14.04, I don't use NetworkManager.

    – Tim Jones
    Jun 15 '15 at 10:10






  • 1





    i am interested to see if there is a flexible way to redirect DNS quesries to different servers, for example by checking the FQDN.. :)

    – nass
    Jun 15 '15 at 12:19


















7















While at site1, I need to connect to site2 via OpenVPN. Once connected, the OpenVPN site2 pushes a DNS nameserver and domain search options. This causes all name resolutions for site1 to fail.



Example:





  1. Physically connected at site1, DHCP pushes DNS options and resolvconf manages them.

    /etc/resolv.conf



    # 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
    nameserver 172.16.1.101
    nameserver 172.16.1.102
    search site1.internal.domain



  2. Open OpenVPN tunnel to site2, OpenVPN pushes dhcp-option DNS and DOMAIN for site2 and /etc/openvpn/update-resolv-conf pushes them to resolvconf.

    /etc/resolv.conf



    # 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
    nameserver 192.168.1.5
    nameserver 172.16.1.101
    nameserver 172.16.1.102
    search site2.internal.domain site1.internal.domain


  3. DNS resolution works for server.site2.internal.domain but fails for server.site1.internal.domain



Is there a way that any failed DNS request to site21 should fall-through to the site1 DNS servers? Or configure resolvconf that only queries for site2.internal.domain should be passed to the site2 nameserver?



I use an Ubuntu 14.04 machine at site1, and the OpenVPN server at site2 is a pfSense 2.2 box. I manage both sites so making changes to either side isn't a problem. Both domains are non-public and internal use only.










share|improve this question























  • I should add that although the laptop is Ubuntu 14.04, I don't use NetworkManager.

    – Tim Jones
    Jun 15 '15 at 10:10






  • 1





    i am interested to see if there is a flexible way to redirect DNS quesries to different servers, for example by checking the FQDN.. :)

    – nass
    Jun 15 '15 at 12:19














7












7








7


0






While at site1, I need to connect to site2 via OpenVPN. Once connected, the OpenVPN site2 pushes a DNS nameserver and domain search options. This causes all name resolutions for site1 to fail.



Example:





  1. Physically connected at site1, DHCP pushes DNS options and resolvconf manages them.

    /etc/resolv.conf



    # 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
    nameserver 172.16.1.101
    nameserver 172.16.1.102
    search site1.internal.domain



  2. Open OpenVPN tunnel to site2, OpenVPN pushes dhcp-option DNS and DOMAIN for site2 and /etc/openvpn/update-resolv-conf pushes them to resolvconf.

    /etc/resolv.conf



    # 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
    nameserver 192.168.1.5
    nameserver 172.16.1.101
    nameserver 172.16.1.102
    search site2.internal.domain site1.internal.domain


  3. DNS resolution works for server.site2.internal.domain but fails for server.site1.internal.domain



Is there a way that any failed DNS request to site21 should fall-through to the site1 DNS servers? Or configure resolvconf that only queries for site2.internal.domain should be passed to the site2 nameserver?



I use an Ubuntu 14.04 machine at site1, and the OpenVPN server at site2 is a pfSense 2.2 box. I manage both sites so making changes to either side isn't a problem. Both domains are non-public and internal use only.










share|improve this question














While at site1, I need to connect to site2 via OpenVPN. Once connected, the OpenVPN site2 pushes a DNS nameserver and domain search options. This causes all name resolutions for site1 to fail.



Example:





  1. Physically connected at site1, DHCP pushes DNS options and resolvconf manages them.

    /etc/resolv.conf



    # 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
    nameserver 172.16.1.101
    nameserver 172.16.1.102
    search site1.internal.domain



  2. Open OpenVPN tunnel to site2, OpenVPN pushes dhcp-option DNS and DOMAIN for site2 and /etc/openvpn/update-resolv-conf pushes them to resolvconf.

    /etc/resolv.conf



    # 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
    nameserver 192.168.1.5
    nameserver 172.16.1.101
    nameserver 172.16.1.102
    search site2.internal.domain site1.internal.domain


  3. DNS resolution works for server.site2.internal.domain but fails for server.site1.internal.domain



Is there a way that any failed DNS request to site21 should fall-through to the site1 DNS servers? Or configure resolvconf that only queries for site2.internal.domain should be passed to the site2 nameserver?



I use an Ubuntu 14.04 machine at site1, and the OpenVPN server at site2 is a pfSense 2.2 box. I manage both sites so making changes to either side isn't a problem. Both domains are non-public and internal use only.







dns openvpn resolvconf resolv.conf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jun 15 '15 at 10:06









Tim JonesTim Jones

63115




63115













  • I should add that although the laptop is Ubuntu 14.04, I don't use NetworkManager.

    – Tim Jones
    Jun 15 '15 at 10:10






  • 1





    i am interested to see if there is a flexible way to redirect DNS quesries to different servers, for example by checking the FQDN.. :)

    – nass
    Jun 15 '15 at 12:19



















  • I should add that although the laptop is Ubuntu 14.04, I don't use NetworkManager.

    – Tim Jones
    Jun 15 '15 at 10:10






  • 1





    i am interested to see if there is a flexible way to redirect DNS quesries to different servers, for example by checking the FQDN.. :)

    – nass
    Jun 15 '15 at 12:19

















I should add that although the laptop is Ubuntu 14.04, I don't use NetworkManager.

– Tim Jones
Jun 15 '15 at 10:10





I should add that although the laptop is Ubuntu 14.04, I don't use NetworkManager.

– Tim Jones
Jun 15 '15 at 10:10




1




1





i am interested to see if there is a flexible way to redirect DNS quesries to different servers, for example by checking the FQDN.. :)

– nass
Jun 15 '15 at 12:19





i am interested to see if there is a flexible way to redirect DNS quesries to different servers, for example by checking the FQDN.. :)

– nass
Jun 15 '15 at 12:19










2 Answers
2






active

oldest

votes


















0














resolv.conf list all availables DNS servers. As long as the first one in the list is up and running, all queries will be send to it. Nothing to the others unless the first one is down. So, if the first DNS server in list is up and know the answer, he reply "I know it !", else he'll say "I'm afraid I don't know...". And that's all.
You have to make 192.168.1.5 (the DNS server of site2) aware of all entries of site1, and vice-versa of course.
Greetings






share|improve this answer































    0














    You can set up a local caching server that will watch your /etc/resolv.conf, as it's changed by resolvconf scripts, and try get its answers from all nameservers listed there.



    On many systems it'll be enough to install the dnsmasq package, in addition to resolvconf.



    The defaults should "just work" provided that no-resolv and no-poll directives are absent from /etc/dnsmasq.conf and lo interface is at the top of /etc/resolvconf/interface-order. Your /etc/resolv.conf should only show nameserver 127.0.0.1.



    If you prefer a fixed setup or connect to multiple unrelated networks and want to avoid leaking your private network names too all nameservers you should configure dnsmasq to query specific servers based on domain:



    # /etc/dnsmasq.conf

    # site1 servers
    nameserver=/site1.internal.domain/172.16.1.101
    nameserver=/site1.internal.domain/172.16.1.102

    # site2 servers
    nameserver=/site2.internal.domain/192.168.1.5

    # default OpenNIC (optional, unless 'no-resolv' is set).
    server=51.15.98.97
    server=172.104.136.243


    For more info on dnsmasq options see here:
    http://oss.segetech.com/intra/srv/dnsmasq.conf






    share|improve this answer








    New contributor



    koniu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















      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',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      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%2f209760%2fopenvpn-resolvconf-and-dns-domain-resolution%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      resolv.conf list all availables DNS servers. As long as the first one in the list is up and running, all queries will be send to it. Nothing to the others unless the first one is down. So, if the first DNS server in list is up and know the answer, he reply "I know it !", else he'll say "I'm afraid I don't know...". And that's all.
      You have to make 192.168.1.5 (the DNS server of site2) aware of all entries of site1, and vice-versa of course.
      Greetings






      share|improve this answer




























        0














        resolv.conf list all availables DNS servers. As long as the first one in the list is up and running, all queries will be send to it. Nothing to the others unless the first one is down. So, if the first DNS server in list is up and know the answer, he reply "I know it !", else he'll say "I'm afraid I don't know...". And that's all.
        You have to make 192.168.1.5 (the DNS server of site2) aware of all entries of site1, and vice-versa of course.
        Greetings






        share|improve this answer


























          0












          0








          0







          resolv.conf list all availables DNS servers. As long as the first one in the list is up and running, all queries will be send to it. Nothing to the others unless the first one is down. So, if the first DNS server in list is up and know the answer, he reply "I know it !", else he'll say "I'm afraid I don't know...". And that's all.
          You have to make 192.168.1.5 (the DNS server of site2) aware of all entries of site1, and vice-versa of course.
          Greetings






          share|improve this answer













          resolv.conf list all availables DNS servers. As long as the first one in the list is up and running, all queries will be send to it. Nothing to the others unless the first one is down. So, if the first DNS server in list is up and know the answer, he reply "I know it !", else he'll say "I'm afraid I don't know...". And that's all.
          You have to make 192.168.1.5 (the DNS server of site2) aware of all entries of site1, and vice-versa of course.
          Greetings







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 22 '18 at 12:30









          user4089user4089

          915




          915

























              0














              You can set up a local caching server that will watch your /etc/resolv.conf, as it's changed by resolvconf scripts, and try get its answers from all nameservers listed there.



              On many systems it'll be enough to install the dnsmasq package, in addition to resolvconf.



              The defaults should "just work" provided that no-resolv and no-poll directives are absent from /etc/dnsmasq.conf and lo interface is at the top of /etc/resolvconf/interface-order. Your /etc/resolv.conf should only show nameserver 127.0.0.1.



              If you prefer a fixed setup or connect to multiple unrelated networks and want to avoid leaking your private network names too all nameservers you should configure dnsmasq to query specific servers based on domain:



              # /etc/dnsmasq.conf

              # site1 servers
              nameserver=/site1.internal.domain/172.16.1.101
              nameserver=/site1.internal.domain/172.16.1.102

              # site2 servers
              nameserver=/site2.internal.domain/192.168.1.5

              # default OpenNIC (optional, unless 'no-resolv' is set).
              server=51.15.98.97
              server=172.104.136.243


              For more info on dnsmasq options see here:
              http://oss.segetech.com/intra/srv/dnsmasq.conf






              share|improve this answer








              New contributor



              koniu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.
























                0














                You can set up a local caching server that will watch your /etc/resolv.conf, as it's changed by resolvconf scripts, and try get its answers from all nameservers listed there.



                On many systems it'll be enough to install the dnsmasq package, in addition to resolvconf.



                The defaults should "just work" provided that no-resolv and no-poll directives are absent from /etc/dnsmasq.conf and lo interface is at the top of /etc/resolvconf/interface-order. Your /etc/resolv.conf should only show nameserver 127.0.0.1.



                If you prefer a fixed setup or connect to multiple unrelated networks and want to avoid leaking your private network names too all nameservers you should configure dnsmasq to query specific servers based on domain:



                # /etc/dnsmasq.conf

                # site1 servers
                nameserver=/site1.internal.domain/172.16.1.101
                nameserver=/site1.internal.domain/172.16.1.102

                # site2 servers
                nameserver=/site2.internal.domain/192.168.1.5

                # default OpenNIC (optional, unless 'no-resolv' is set).
                server=51.15.98.97
                server=172.104.136.243


                For more info on dnsmasq options see here:
                http://oss.segetech.com/intra/srv/dnsmasq.conf






                share|improve this answer








                New contributor



                koniu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






















                  0












                  0








                  0







                  You can set up a local caching server that will watch your /etc/resolv.conf, as it's changed by resolvconf scripts, and try get its answers from all nameservers listed there.



                  On many systems it'll be enough to install the dnsmasq package, in addition to resolvconf.



                  The defaults should "just work" provided that no-resolv and no-poll directives are absent from /etc/dnsmasq.conf and lo interface is at the top of /etc/resolvconf/interface-order. Your /etc/resolv.conf should only show nameserver 127.0.0.1.



                  If you prefer a fixed setup or connect to multiple unrelated networks and want to avoid leaking your private network names too all nameservers you should configure dnsmasq to query specific servers based on domain:



                  # /etc/dnsmasq.conf

                  # site1 servers
                  nameserver=/site1.internal.domain/172.16.1.101
                  nameserver=/site1.internal.domain/172.16.1.102

                  # site2 servers
                  nameserver=/site2.internal.domain/192.168.1.5

                  # default OpenNIC (optional, unless 'no-resolv' is set).
                  server=51.15.98.97
                  server=172.104.136.243


                  For more info on dnsmasq options see here:
                  http://oss.segetech.com/intra/srv/dnsmasq.conf






                  share|improve this answer








                  New contributor



                  koniu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  You can set up a local caching server that will watch your /etc/resolv.conf, as it's changed by resolvconf scripts, and try get its answers from all nameservers listed there.



                  On many systems it'll be enough to install the dnsmasq package, in addition to resolvconf.



                  The defaults should "just work" provided that no-resolv and no-poll directives are absent from /etc/dnsmasq.conf and lo interface is at the top of /etc/resolvconf/interface-order. Your /etc/resolv.conf should only show nameserver 127.0.0.1.



                  If you prefer a fixed setup or connect to multiple unrelated networks and want to avoid leaking your private network names too all nameservers you should configure dnsmasq to query specific servers based on domain:



                  # /etc/dnsmasq.conf

                  # site1 servers
                  nameserver=/site1.internal.domain/172.16.1.101
                  nameserver=/site1.internal.domain/172.16.1.102

                  # site2 servers
                  nameserver=/site2.internal.domain/192.168.1.5

                  # default OpenNIC (optional, unless 'no-resolv' is set).
                  server=51.15.98.97
                  server=172.104.136.243


                  For more info on dnsmasq options see here:
                  http://oss.segetech.com/intra/srv/dnsmasq.conf







                  share|improve this answer








                  New contributor



                  koniu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.








                  share|improve this answer



                  share|improve this answer






                  New contributor



                  koniu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.








                  answered 1 hour ago









                  koniukoniu

                  1012




                  1012




                  New contributor



                  koniu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.




                  New contributor




                  koniu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.
































                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f209760%2fopenvpn-resolvconf-and-dns-domain-resolution%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                      Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                      Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...