ifupdown on Ubuntu 22.04 fails to set DNS correctly -> DNS resolution does not work

Bug #2017792 reported by Thomas Dreibholz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ifupdown (Ubuntu)
New
Undecided
Unassigned

Bug Description

On a Ubuntu 22.04 system with /etc/network/interfaces configuration (ifupdown) instead of Netplan, DNS is not set correctly. Therefore, DNS resolution does not work.

This explains the issue: https://unix.stackexchange.com/questions/714901/dns-broken-when-using-ifupdown-and-systemd-resolved-after-upgrade-to-ubuntu-22-0

Solution:

Fix in /etc/network/if-up.d/resolved:
Old: "$DNS"="$NEW_DNS"
New: $DNS="$NEW_DNS"

Old: "$DOMAINS"="$NEW_DOMAINS"
New: $DOMAINS="$NEW_DOMAINS"

/etc/network/if-up.d/resolved writes files /run/network/ifupdown-<PROTOCOL>-<INTERFACE> containing the DNS configuration. The fix ensures that the files /run/network/ifupdown-<PROTOCOL>-<INTERFACE> contain the correct syntax without quotes for the variable name.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: ifupdown 0.8.36+nmu1ubuntu3
ProcVersionSignature: Ubuntu 5.19.0-41.42~22.04.1-generic 5.19.17
Uname: Linux 5.19.0-41-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.4
Architecture: amd64
CasperMD5CheckResult: pass
Date: Wed Apr 26 15:04:14 2023
InstallationDate: Installed on 2022-12-08 (139 days ago)
InstallationMedia: Ubuntu-Server 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809)
ProcEnviron:
 LANGUAGE=nb:de:en_US
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ifupdown
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.network.if-up.d.resolved: 2023-04-26T14:36:08.277304

Revision history for this message
Thomas Dreibholz (dreibh) wrote :
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.