Upgrade to groovy breaks DNS resolution

Bug #1910273 reported by Pēteris Kļaviņš
72
This bug affects 13 people
Affects Status Importance Assigned to Milestone
ifupdown (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

~# lsb_release -rd
Description: Ubuntu 20.10
Release: 20.10
~# apt-cache policy ifupdown
ifupdown:
  Instalēts: 0.8.35ubuntu2
  Kandidāts: 0.8.35ubuntu2
  Versiju tabula:
 *** 0.8.35ubuntu2 500
        500 http://mirrors.digitalocean.com/ubuntu groovy/universe amd64 Packages
        100 /var/lib/dpkg/status
~#

Problem: Upon upgrade from Ubuntu 20.04 to Ubuntu 20.10, I expected name resolution upon reboot to work as usual.

What happened:
a) /var/log/syslog sprinkled with error messages:
- /etc/network/if-up.d/resolved: 12: mystatedir: not found
- /etc/network/if-up.d/resolved: 70: DNS: not found
- /etc/network/if-up.d/resolved: 1: /run/network/ifupdown-inet-eth0: DNS=8.8.8.8 8.8.4.4: not found
b) resolvectl dns returning no name servers

Investigation:
Recently changed /etc/network/if-up.d/resolved and /etc/network/if-down.d/resolved files contain programming errors. See https://git.launchpad.net/ubuntu/+source/ifupdown/commit/?id=54fec5eedfd59adaffe9021c271914578dd05d1b .

Fix:
$ diff /Users/pklavins/Downloads/ifupdown-0.8.35ubuntu2/debian/if-down.d/resolved if-down.d_resolved
12c12
< mystatedir statedir ifindex interface
---
> # local mystatedir statedir ifindex interface
$ diff /Users/pklavins/Downloads/ifupdown-0.8.35ubuntu2/debian/if-up.d/resolved if-up.d_resolved
12c12
< mystatedir statedir ifindex interface
---
> # local mystatedir statedir ifindex interface
39,40c39,40
< DNS=DNS
< DOMAINS=DOMAINS
---
> DNS=$DNS
> DOMAINS=$DOMAINS
42,43c42,43
< DNS=DNS6
< DOMAINS=DOMAINS6
---
> DNS=$DNS6
> DOMAINS=$DOMAINS6
47c47
< "$DNS"="$NEW_DNS"
---
> DNS="$NEW_DNS"
51c51
< "$DOMAINS"="$NEW_DOMAINS"
---
> DOMAINS="$NEW_DOMAINS"
70c70
< DNS DNS6 DOMAINS DOMAINS6 DEFAULT_ROUTE
---
> # local DNS DNS6 DOMAINS DOMAINS6 DEFAULT_ROUTE
$

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ifupdown (Ubuntu):
status: New → Confirmed
Revision history for this message
Walter Schneider (walter-schneider) wrote :

I am getting DOMAINS in /etc/resolve.conf:

DOMAINS is initialized with "DOMAINS" in `/etc/network/if-up.d/resolved`
and set in /run/systemd/resolve/netif/*

```bash
$ cat /run/systemd/resolve/netif/3
# This is private data. Do not parse.
LLMNR=yes
MDNS=no
SERVERS=DNS
DOMAINS=DOMAINS
```

systemd-resolved adds DOMAINS to domains-searchlist:
```bash
cat /etc/resolv.conf
# This is /run/systemd/resolve/resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.1
nameserver 192.168.2.1
search DOMAINS lan
```

DOMAINS=$DOMAINS would have no effect and could be omitted,

As there are further errors form the if-down script (resolved: 12: mystatedir: not found),

i've removed both `/etc/network/if-up.d/resolved` and `/etc/network/if-down.d/resolved`.

Revision history for this message
falstaff (falstaff) wrote :

I've run into the same problem on a server upgraded from 18.04 to 20.04 and 22.04. After the last upgrade step, DNS did not work anymore. It seems that DNS information does not get properly propagated from ifupdown configuration (/etc/network/interfaces) to systemd-resolved.

The main issue seems to be this error:
```
/etc/network/if-up.d/resolved: 70: DNS: not found
```

It seems that the state files e.g. /run/network/ifupdown-inet-eth0 contain the following string:
```
"DNS"="<ip-of-dns>"

When the script tries to source the file around line 78, this fails. I fixed it by removing the quotes around $DNS and $DOMAINS on line 47 and 51.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.