systemd-resolved ignores per-connection DNS split-horizon rules after NetworkManager upgrade on Ubuntu 22.04
Environment
Ubuntu 22.04 desktop with NetworkManager 1.40 (recently upgraded from 1.38), systemd-resolved acting as local stub resolver (127.0.0.53), multiple VPN and wired connections with per-connection 'search' and 'dns' settings intended to provide split-horizon for internal.example.corp.
Symptoms
Internal hostnames under internal.example.corp that previously resolved to internal IPs now resolve to public/global IPs or time out when the VPN is active. DNS resolution via systemd-resolved returns different answers depending on the system's active link order, not per-connection split-horizon rules.
Observations
resolvectl status shows multiple Link entries with DNS servers configured but 'Domains' field empty for the VPN link despite nmcli showing domain=internal.example.corp on that connection. /etc/resolv.conf still points to 127.0.0.53. dnsmasq was not in use. Reverting the NetworkManager package to the older version inside a test VM restored per-connection domain behavior. Enabling verbose NetworkManager logging shows a change in how NM writes DNS domains to systemd-resolved via the DBus API (the domain field is omitted).
Already attempted
Restarted NetworkManager and systemd-resolved services, ran 'resolvectl flush-caches', recreated the VPN connection profile with explicit 'search' and 'domain' options, added the internal domain to /etc/hosts for a single host (temporary fix), tested nslookup pointing directly to the VPN's DNS server which returned correct internal addresses, and tested downgrading NetworkManager on a nonproduction workstation which reproduced the previous, working behavior.
Question
Which reversible configuration changes or diagnostics will restore per-connection split-horizon resolution with systemd-resolved under the upgraded NetworkManager, and how to determine whether the NM upgrade changed DBus contract semantics, or if a local configuration workaround (e.g., per-link resolved configuration) is preferable until an official fix or patch is available?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags