netplan overrides systemd network configuration, but does not support mdns settings
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| netplan.io (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Bug Description
Using Ubuntu 22.04:
netplan blocks and inhibits the MulticastDNS configuration in systemd/resolved.
I'm in a network with a poor router, which doesn't put DHCP clients into a DNS zone, so machines need to find each other with mdns. Since netplan overrides the systemd network configuration, but does not support mdns itself, it effectively makes it impossible to properly configure mdns.
In order to have mdns running, two steps are required:
1. it must be enabled in common in /etc/systemd/
2. it must be configured per device, eg. command line resolvectl mdns eth0 yes
But to have it configured automatically, systemd/resolved use the method of having
/etc/systemd/
[Match]
Name=eth0
[Network]
MulticastDNS=yes
which has no effect at all. the reason seems to be that netplan overrides this:
# networkctl status eth0
...
...
thus resolved/systemd seem to use this file instead of the handmade one.
So there seems to be no proper way to enable mdns.
The further problem is, that I cannot simply add a systemd unit to run this command, because the problem already occurs in cloud-init installations. There's two ways to run the command:
a) as a bootcmd, but has no effect, because too early in boot process.
b) as a runcmd, which works, but comes too late, package installation by cloud-init has already failed then.
So netplan effectively seems to break the mdns functionality of systemd by overriding the configuration but not supporting mdns.

I think your eth0.network config file is in conflict with the 10-netplan- eth0.network config file (generated by netplan).
Try placing an override config file instead to extend the configuration generated by netplan:
e.g. in /etc/systemd/ network/ 10-netplan- eth0.network. d/override. conf put:
[Network]
MulticastDNS=yes