1

I have been researching and trying stuff out all morning and I can't seem to wrap my head around it. Bear with me, in case I am missing something basic here.

The Scenario:

I have configured interfaces with netplan (ubuntu server 18.04), and everything is working perfectly, except for the DNS part. When i do a "nslookup local-domain-name " i get an answer by 8.8.8.8 Instead, i want an answer by, say, 10.12.101.101

My Goal:

Get the system (i.e. nslookup) to use the local nameserver, that I have configured via a netplan config file, when looking up local domain-names.

Current config:

For a specific interface eth0 i have configured local nameservers that are to be used, when querying local IPs / a local network.

The /etc/resolv.conf contains a nameserver entry for 8.8.8.8

The netplan.conf looks like this:

network:
    ethernets:
        eth0:
            addresses:
            - 10.205.10.16/24
            match:
                macaddress: "xxxxxxxx"
            nameservers: {
                    addresses: [10.12.101.101, 10.12.101.102, 10.12.101.103]
                }
            routes:
            - xxxxxxxxxx

        eth1:
            addresses:
            - xxxx/28
            match:
                macaddress: "xxxxx"
            gateway4: xxxxxx

    version: 2

And this is the output of "systemd-resolve --status"

Global
         DNS Servers: 8.8.8.8
          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 3 (eth1)
      Current Scopes: none
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 2 (eth0)
      Current Scopes: DNS
       LLMNR setting: yes
MulticastDNS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 10.12.101.101
                      10.12.101.102
                      10.12.101.103

What else have i configured:

  • systemd-networkd is enabled and running.
  • systemd-resolved is enabled and running.
  • networking.service is disabled.
  • resolvconf, dnsmasq, dnsmasq-base - packages are not installed.
  • /etc/nsswitch.conf looks like this: "hosts: files resolve [!UNAVAIL=return] dns".
  • rebooted System after every change i made.

Thanks in advance for any advice. I hope, this is a reasonable question.

1 Answer 1

2

The /etc/resolv.conf contains a nameserver entry for 8.8.8.8

Where does this come from? Is /etc/resolv.conf a static file, instead of a symlink to ../run/systemd/resolve/stub-resolv.conf, as it should be?

Your netplan config does not mention 8.8.8.8, and this is not a default in Ubuntu. But systemd-resolved will pick up statically-configured DNS servers and inject them into its config.

It may be that changing /etc/resolv.conf to the symlink it's expected to be, and then running sudo systemctl restart systemd-resolved, may be enough to solve your problem.

1
  • 2
    thank you so much! This was really what solved it for me! The resolv.conf was a static file which was not a symlink. I set it to a different path though. Here is what i did exactly: rm /etc/resolv.conf. ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf reboot //or just restart the networking and resolved service.
    – JaKoko
    Apr 14, 2020 at 7:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .