Score:0

Ubuntu Server 20.04.3 LTS 00-installer-config.yaml or resolv.conf for DNS settings

in flag

So I'm freaking confused. I'm trying to specify local DNS servers for our domain. This Ubuntu Server 20.04.3 doesn't use the old interfaces file. I configured the yaml file for netplan,

    # This is the network config written by 'subiquity'
network:
  bonds:
    bond0:
      addresses:
      - 172.17.17.71/24
      gateway4: 172.17.17.1
      interfaces:
      - eno1
      - eno2
      nameservers:
        addresses:
        - 172.17.17.31
        - 172.17.17.41
        - 172.17.17.51
        - 172.17.17.61
        search:
        - local.mydomain.com
      parameters:
        mode: balance-rr
  ethernets:
    eno1: {}
    eno2: {}
    eno3:
      dhcp4: true
    eno4:
      dhcp4: true
  version: 2

but this doesn't seem to set the new DNS servers either, nor does the systemd elements. If I try to status:

admin@ubu:/$ resolvectl status
Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.

I have to restart systemd:

admin@ubu:/$ systemctl restart systemd-resolved
admin@ubu:/$ resolvectl status

Now status works.

Global
       LLMNR setting: no
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
          DNS Domain: local.mydomain.com
          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 (bond0)
      Current Scopes: DNS
DefaultRoute setting: yes
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no
         DNS Servers: 172.17.17.31
                      172.17.17.41
                      172.17.17.51
                      172.17.17.61
          DNS Domain: local.mydomain.com

Link 5 (eno4)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 4 (eno3)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 3 (eno2)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

Link 2 (eno1)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: yes
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: no
    DNSSEC supported: no

I have tried editing /etc/resolv.conf to hard code the DNS server and that actually works, and changes the global DNS listings shown in status (the file itself says I'm not supposed to edit it though!) and editing the yaml file for netplan changes the DNS listings for bond0. DNS listings in the bond0 section of status seem to have no effect on the failing network drive maps.

So I have three issues.

  1. Systemd doesn't start correctly on boot.
  2. netplan doesn't seem to do what it should, as DNS doesn't seem to function.
  3. /etc/resolv.conf shouldn't be edited.

What do I do to sort out this networking mess?

us flag
Please show both the content of your netplan config, and the output of resolvectl status.
geardogg avatar
in flag
@slangasek I've edited the post to include the config (without hardcoding servers in the /etc/resolv.conf file. The posted config doesn't work, while hardcoding the file does. confused.
us flag
ok, the netplan yaml looks correct and the `resolvectl status` output matches and looks correct. The only real problem I see here is that systemd-resolved did not start correctly at boot. I suggest you look at the logs for this systemd unit with `journalctl -b0 -u systemd-resolved`.
geardogg avatar
in flag
No entries show with that command, and the window it states is many months long. Further, the config shown doesn't work. Apparently the dns server addresses need to show in the Global section of the systemD status, and netplan doesn't seem to do that. The only way I've gotten it to work is by hard coding the dns servers in the resolv.conf, but the file itself says not to edit it.
us flag
"the dns server addresses need to show in the Global section of the systemd status" - not true. DNS should work just fine when the servers are associated with a particular network interface, as long as that interface is up. The definite bug still from what you've described is resolved not starting on boot. If you can reboot and then check `systemctl status systemd-resolved.service` that may provide more clues.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.