Ubuntu 18.04 systemd-resolve doesn't read the /etc/resolv.conf properly












2















I faced a strange issue with my Ubuntu 18.04. I use openfortivpn to connect to my company resources and it worked OK. I also use openvpn to connect to some different resources as well, sometimes even simultaneously.
Today all resources behind the vpn became unreachable and I figured out this is related to some DNS settings on my PC.



With no active openfortivpn connection:



ll /etc/resolv.conf
lrwxrwxrwx 1 root root 37 Jan 9 10:52 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf

grep name /run/systemd/resolve/*.conf
/run/systemd/resolve/resolv.conf:nameserver 192.168.139.2
/run/systemd/resolve/stub-resolv.conf:nameserver 127.0.0.53



With active openfortivpn:



ll /etc/resolv.conf
lrwxrwxrwx 1 root root 37 Jan 9 10:52 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf

grep name /run/systemd/resolve/*.conf
resolv.conf:nameserver 192.168.139.2
stub-resolv.conf:nameserver 10.220.64.161
stub-resolv.conf:nameserver 10.220.64.162


As you can see, the openfortivpn has inserted 2 new nameservers into the `/run/systemd/resolve/stub-resolv.conf` which is fine.
But seems like the `systemd-resolve` doesn't take this new config (no DNS server for `ppp0` interface) and internal resources behind the VPN were not reachable:

sudo systemd-resolve --status
Global
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test

Link 6 (ppp0)
Current Scopes: none
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no

Link 2 (ens33)
Current Scopes: DNS
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.139.2
DNS Domain: localdomain


So I tried to add the DNS manually into the systemd-resolve:



sudo systemd-resolve --set-dns=10.220.64.161 --set-domain=localdomain --set-llmnr=yes --set-mdns=no --set-dnssec=no --interface=ppp0

systemd-resolve --status
Global
DNSSEC NTA: 10.in-addr.arpa
16.172.in-addr.arpa
168.192.in-addr.arpa
17.172.in-addr.arpa
18.172.in-addr.arpa
19.172.in-addr.arpa
20.172.in-addr.arpa
21.172.in-addr.arpa
22.172.in-addr.arpa
23.172.in-addr.arpa
24.172.in-addr.arpa
25.172.in-addr.arpa
26.172.in-addr.arpa
27.172.in-addr.arpa
28.172.in-addr.arpa
29.172.in-addr.arpa
30.172.in-addr.arpa
31.172.in-addr.arpa
corp
d.f.ip6.arpa
home
internal
intranet
lan
local
private
test

Link 6 (ppp0)
Current Scopes: DNS
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 10.220.64.161
DNS Domain: localdomain

Link 2 (ens33)
Current Scopes: DNS
LLMNR setting: yes
MulticastDNS setting: no
DNSSEC setting: no
DNSSEC supported: no
DNS Servers: 192.168.139.2
DNS Domain: localdomain

And finally it works.
Any idea what is the problem here? Isn't this somehow related to `openvpn-systemd-resolved` because I can remember I installed this package recently in order to be able to use my other openvpn connections.

Thank you a lot for any advice.
Michal.










share|improve this question







New contributor




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

























    2















    I faced a strange issue with my Ubuntu 18.04. I use openfortivpn to connect to my company resources and it worked OK. I also use openvpn to connect to some different resources as well, sometimes even simultaneously.
    Today all resources behind the vpn became unreachable and I figured out this is related to some DNS settings on my PC.



    With no active openfortivpn connection:



    ll /etc/resolv.conf
    lrwxrwxrwx 1 root root 37 Jan 9 10:52 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf

    grep name /run/systemd/resolve/*.conf
    /run/systemd/resolve/resolv.conf:nameserver 192.168.139.2
    /run/systemd/resolve/stub-resolv.conf:nameserver 127.0.0.53



    With active openfortivpn:



    ll /etc/resolv.conf
    lrwxrwxrwx 1 root root 37 Jan 9 10:52 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf

    grep name /run/systemd/resolve/*.conf
    resolv.conf:nameserver 192.168.139.2
    stub-resolv.conf:nameserver 10.220.64.161
    stub-resolv.conf:nameserver 10.220.64.162


    As you can see, the openfortivpn has inserted 2 new nameservers into the `/run/systemd/resolve/stub-resolv.conf` which is fine.
    But seems like the `systemd-resolve` doesn't take this new config (no DNS server for `ppp0` interface) and internal resources behind the VPN were not reachable:

    sudo systemd-resolve --status
    Global
    DNSSEC NTA: 10.in-addr.arpa
    16.172.in-addr.arpa
    168.192.in-addr.arpa
    17.172.in-addr.arpa
    18.172.in-addr.arpa
    19.172.in-addr.arpa
    20.172.in-addr.arpa
    21.172.in-addr.arpa
    22.172.in-addr.arpa
    23.172.in-addr.arpa
    24.172.in-addr.arpa
    25.172.in-addr.arpa
    26.172.in-addr.arpa
    27.172.in-addr.arpa
    28.172.in-addr.arpa
    29.172.in-addr.arpa
    30.172.in-addr.arpa
    31.172.in-addr.arpa
    corp
    d.f.ip6.arpa
    home
    internal
    intranet
    lan
    local
    private
    test

    Link 6 (ppp0)
    Current Scopes: none
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no

    Link 2 (ens33)
    Current Scopes: DNS
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no
    DNS Servers: 192.168.139.2
    DNS Domain: localdomain


    So I tried to add the DNS manually into the systemd-resolve:



    sudo systemd-resolve --set-dns=10.220.64.161 --set-domain=localdomain --set-llmnr=yes --set-mdns=no --set-dnssec=no --interface=ppp0

    systemd-resolve --status
    Global
    DNSSEC NTA: 10.in-addr.arpa
    16.172.in-addr.arpa
    168.192.in-addr.arpa
    17.172.in-addr.arpa
    18.172.in-addr.arpa
    19.172.in-addr.arpa
    20.172.in-addr.arpa
    21.172.in-addr.arpa
    22.172.in-addr.arpa
    23.172.in-addr.arpa
    24.172.in-addr.arpa
    25.172.in-addr.arpa
    26.172.in-addr.arpa
    27.172.in-addr.arpa
    28.172.in-addr.arpa
    29.172.in-addr.arpa
    30.172.in-addr.arpa
    31.172.in-addr.arpa
    corp
    d.f.ip6.arpa
    home
    internal
    intranet
    lan
    local
    private
    test

    Link 6 (ppp0)
    Current Scopes: DNS
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no
    DNS Servers: 10.220.64.161
    DNS Domain: localdomain

    Link 2 (ens33)
    Current Scopes: DNS
    LLMNR setting: yes
    MulticastDNS setting: no
    DNSSEC setting: no
    DNSSEC supported: no
    DNS Servers: 192.168.139.2
    DNS Domain: localdomain

    And finally it works.
    Any idea what is the problem here? Isn't this somehow related to `openvpn-systemd-resolved` because I can remember I installed this package recently in order to be able to use my other openvpn connections.

    Thank you a lot for any advice.
    Michal.










    share|improve this question







    New contributor




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























      2












      2








      2








      I faced a strange issue with my Ubuntu 18.04. I use openfortivpn to connect to my company resources and it worked OK. I also use openvpn to connect to some different resources as well, sometimes even simultaneously.
      Today all resources behind the vpn became unreachable and I figured out this is related to some DNS settings on my PC.



      With no active openfortivpn connection:



      ll /etc/resolv.conf
      lrwxrwxrwx 1 root root 37 Jan 9 10:52 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf

      grep name /run/systemd/resolve/*.conf
      /run/systemd/resolve/resolv.conf:nameserver 192.168.139.2
      /run/systemd/resolve/stub-resolv.conf:nameserver 127.0.0.53



      With active openfortivpn:



      ll /etc/resolv.conf
      lrwxrwxrwx 1 root root 37 Jan 9 10:52 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf

      grep name /run/systemd/resolve/*.conf
      resolv.conf:nameserver 192.168.139.2
      stub-resolv.conf:nameserver 10.220.64.161
      stub-resolv.conf:nameserver 10.220.64.162


      As you can see, the openfortivpn has inserted 2 new nameservers into the `/run/systemd/resolve/stub-resolv.conf` which is fine.
      But seems like the `systemd-resolve` doesn't take this new config (no DNS server for `ppp0` interface) and internal resources behind the VPN were not reachable:

      sudo systemd-resolve --status
      Global
      DNSSEC NTA: 10.in-addr.arpa
      16.172.in-addr.arpa
      168.192.in-addr.arpa
      17.172.in-addr.arpa
      18.172.in-addr.arpa
      19.172.in-addr.arpa
      20.172.in-addr.arpa
      21.172.in-addr.arpa
      22.172.in-addr.arpa
      23.172.in-addr.arpa
      24.172.in-addr.arpa
      25.172.in-addr.arpa
      26.172.in-addr.arpa
      27.172.in-addr.arpa
      28.172.in-addr.arpa
      29.172.in-addr.arpa
      30.172.in-addr.arpa
      31.172.in-addr.arpa
      corp
      d.f.ip6.arpa
      home
      internal
      intranet
      lan
      local
      private
      test

      Link 6 (ppp0)
      Current Scopes: none
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no

      Link 2 (ens33)
      Current Scopes: DNS
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no
      DNS Servers: 192.168.139.2
      DNS Domain: localdomain


      So I tried to add the DNS manually into the systemd-resolve:



      sudo systemd-resolve --set-dns=10.220.64.161 --set-domain=localdomain --set-llmnr=yes --set-mdns=no --set-dnssec=no --interface=ppp0

      systemd-resolve --status
      Global
      DNSSEC NTA: 10.in-addr.arpa
      16.172.in-addr.arpa
      168.192.in-addr.arpa
      17.172.in-addr.arpa
      18.172.in-addr.arpa
      19.172.in-addr.arpa
      20.172.in-addr.arpa
      21.172.in-addr.arpa
      22.172.in-addr.arpa
      23.172.in-addr.arpa
      24.172.in-addr.arpa
      25.172.in-addr.arpa
      26.172.in-addr.arpa
      27.172.in-addr.arpa
      28.172.in-addr.arpa
      29.172.in-addr.arpa
      30.172.in-addr.arpa
      31.172.in-addr.arpa
      corp
      d.f.ip6.arpa
      home
      internal
      intranet
      lan
      local
      private
      test

      Link 6 (ppp0)
      Current Scopes: DNS
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no
      DNS Servers: 10.220.64.161
      DNS Domain: localdomain

      Link 2 (ens33)
      Current Scopes: DNS
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no
      DNS Servers: 192.168.139.2
      DNS Domain: localdomain

      And finally it works.
      Any idea what is the problem here? Isn't this somehow related to `openvpn-systemd-resolved` because I can remember I installed this package recently in order to be able to use my other openvpn connections.

      Thank you a lot for any advice.
      Michal.










      share|improve this question







      New contributor




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












      I faced a strange issue with my Ubuntu 18.04. I use openfortivpn to connect to my company resources and it worked OK. I also use openvpn to connect to some different resources as well, sometimes even simultaneously.
      Today all resources behind the vpn became unreachable and I figured out this is related to some DNS settings on my PC.



      With no active openfortivpn connection:



      ll /etc/resolv.conf
      lrwxrwxrwx 1 root root 37 Jan 9 10:52 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf

      grep name /run/systemd/resolve/*.conf
      /run/systemd/resolve/resolv.conf:nameserver 192.168.139.2
      /run/systemd/resolve/stub-resolv.conf:nameserver 127.0.0.53



      With active openfortivpn:



      ll /etc/resolv.conf
      lrwxrwxrwx 1 root root 37 Jan 9 10:52 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf

      grep name /run/systemd/resolve/*.conf
      resolv.conf:nameserver 192.168.139.2
      stub-resolv.conf:nameserver 10.220.64.161
      stub-resolv.conf:nameserver 10.220.64.162


      As you can see, the openfortivpn has inserted 2 new nameservers into the `/run/systemd/resolve/stub-resolv.conf` which is fine.
      But seems like the `systemd-resolve` doesn't take this new config (no DNS server for `ppp0` interface) and internal resources behind the VPN were not reachable:

      sudo systemd-resolve --status
      Global
      DNSSEC NTA: 10.in-addr.arpa
      16.172.in-addr.arpa
      168.192.in-addr.arpa
      17.172.in-addr.arpa
      18.172.in-addr.arpa
      19.172.in-addr.arpa
      20.172.in-addr.arpa
      21.172.in-addr.arpa
      22.172.in-addr.arpa
      23.172.in-addr.arpa
      24.172.in-addr.arpa
      25.172.in-addr.arpa
      26.172.in-addr.arpa
      27.172.in-addr.arpa
      28.172.in-addr.arpa
      29.172.in-addr.arpa
      30.172.in-addr.arpa
      31.172.in-addr.arpa
      corp
      d.f.ip6.arpa
      home
      internal
      intranet
      lan
      local
      private
      test

      Link 6 (ppp0)
      Current Scopes: none
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no

      Link 2 (ens33)
      Current Scopes: DNS
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no
      DNS Servers: 192.168.139.2
      DNS Domain: localdomain


      So I tried to add the DNS manually into the systemd-resolve:



      sudo systemd-resolve --set-dns=10.220.64.161 --set-domain=localdomain --set-llmnr=yes --set-mdns=no --set-dnssec=no --interface=ppp0

      systemd-resolve --status
      Global
      DNSSEC NTA: 10.in-addr.arpa
      16.172.in-addr.arpa
      168.192.in-addr.arpa
      17.172.in-addr.arpa
      18.172.in-addr.arpa
      19.172.in-addr.arpa
      20.172.in-addr.arpa
      21.172.in-addr.arpa
      22.172.in-addr.arpa
      23.172.in-addr.arpa
      24.172.in-addr.arpa
      25.172.in-addr.arpa
      26.172.in-addr.arpa
      27.172.in-addr.arpa
      28.172.in-addr.arpa
      29.172.in-addr.arpa
      30.172.in-addr.arpa
      31.172.in-addr.arpa
      corp
      d.f.ip6.arpa
      home
      internal
      intranet
      lan
      local
      private
      test

      Link 6 (ppp0)
      Current Scopes: DNS
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no
      DNS Servers: 10.220.64.161
      DNS Domain: localdomain

      Link 2 (ens33)
      Current Scopes: DNS
      LLMNR setting: yes
      MulticastDNS setting: no
      DNSSEC setting: no
      DNSSEC supported: no
      DNS Servers: 192.168.139.2
      DNS Domain: localdomain

      And finally it works.
      Any idea what is the problem here? Isn't this somehow related to `openvpn-systemd-resolved` because I can remember I installed this package recently in order to be able to use my other openvpn connections.

      Thank you a lot for any advice.
      Michal.







      networking dns vpn openvpn






      share|improve this question







      New contributor




      MichalD 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 question







      New contributor




      MichalD 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 question




      share|improve this question






      New contributor




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









      asked Jan 9 at 11:10









      MichalDMichalD

      111




      111




      New contributor




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





      New contributor





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






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






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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
          });


          }
          });






          MichalD is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1108260%2fubuntu-18-04-systemd-resolve-doesnt-read-the-etc-resolv-conf-properly%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          MichalD is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          MichalD is a new contributor. Be nice, and check out our Code of Conduct.













          MichalD is a new contributor. Be nice, and check out our Code of Conduct.












          MichalD is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Ask Ubuntu!


          • 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%2faskubuntu.com%2fquestions%2f1108260%2fubuntu-18-04-systemd-resolve-doesnt-read-the-etc-resolv-conf-properly%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

          Category:香港粉麵

          List *all* the tuples!

          Channel [V]