3

I have a homelab that I exposes itself to homeserver.local. It suddenly stopped working this morning, and I've been debugging it but can't quite pinpoint the reason.

The server has two network adapters, enp2s0 and enp3s0, but only enp3s0 is active and configured.

This is my netplan:

network:
  version: 2
  ethernets:
    enp3s0:
      dhcp4: no
      dhcp6: no
      addresses:
        - 192.168.178.94/24
      nameservers:
        addresses: [1.1.1.1]
      dhcp4-overrides:
        use-dns: no

According to systemd-resolved and networked, all is "well"

Oct 30 11:42:13 homeserver systemd-networkd[14681]: veth00c2c8d: Gained IPv6LL
Oct 30 11:42:13 homeserver systemd-networkd[14681]: veth4b68388: Gained IPv6LL
Oct 30 11:42:13 homeserver systemd-networkd[14681]: veth477204f: Gained IPv6LL
Oct 30 11:42:13 homeserver systemd-networkd[14681]: veth60c4872: Gained IPv6LL
Oct 30 11:42:13 homeserver systemd-networkd[14681]: veth3f7c0d6: Gained IPv6LL
Oct 30 11:42:13 homeserver systemd-networkd[14681]: tailscale0: Gained IPv6LL
Oct 30 11:42:13 homeserver systemd-networkd[14681]: Enumeration completed
Oct 30 11:42:13 homeserver systemd[1]: Started systemd-networkd.service - Network Configuration.
Oct 30 11:42:13 homeserver systemd-networkd[14681]: enp3s0: Configuring with /run/systemd/network/10-netplan-enp3s0.network.
Oct 30 11:42:13 homeserver systemd-networkd[14681]: enp3s0: DHCPv4 address 192.168.178.94/24, gateway 192.168.178.1 acquired from 192.168.178.1
Oct 30 11:42:18 homeserver systemd[1]: Starting systemd-resolved.service - Network Name Resolution...
Oct 30 11:42:18 homeserver systemd-resolved[14713]: Positive Trust Anchors:
Oct 30 11:42:18 homeserver systemd-resolved[14713]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Oct 30 11:42:18 homeserver systemd-resolved[14713]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in>
Oct 30 11:42:18 homeserver systemd-resolved[14713]: Using system hostname 'homeserver'.
Oct 30 11:42:18 homeserver systemd[1]: Started systemd-resolved.service - Network Name Resolution.
Oct 30 11:42:18 homeserver systemd-resolved[14713]: Flushed all caches.

Here is where things get weird: resolvectl says that Multicast is enable for the other adapter:

kowa@homeserver:~$ resolvectl mdns
Global: yes
Link 2 (enp2s0): yes
Link 3 (enp3s0): no
Link 5 (br-8f6820a83f6d): yes
Link 6 (docker0): yes
Link 8 (veth0d30cc2): yes
Link 10 (veth340868c): yes
Link 12 (vetha47528b): yes
Link 14 (vethebc06f0): yes
Link 18 (veth00c2c8d): yes
Link 20 (veth4b68388): yes
Link 22 (veth477204f): yes
Link 30 (veth60c4872): yes
Link 32 (veth3f7c0d6): yes
Link 35 (tailscale0): no

all this configuration is managed by Ansible and so I created a filed under /etc/systemd/network/10-netplan-enp3s0.network.d/override.conf and added this:

[Network]
MulticastDNS=yes

and then run netplan apply but the mDNS on enp3s0 is still down, even after a reboot

I noticed one thing: I have Home Assistant running via Docker container, when it is enabled, systemd-resolved complains that there is already a mDNS running:

Oct 30 11:49:48 homeserver systemd[1]: Starting systemd-resolved.service - Network Name Resolution...
Oct 30 11:49:49 homeserver systemd-resolved[17681]: Positive Trust Anchors:
Oct 30 11:49:49 homeserver systemd-resolved[17681]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d
Oct 30 11:49:49 homeserver systemd-resolved[17681]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in>
Oct 30 11:49:49 homeserver systemd-resolved[17681]: Using system hostname 'homeserver'.
Oct 30 11:49:49 homeserver systemd-resolved[17681]: mDNS-IPv4: There appears to be another mDNS responder running, or previously systemd-resolved crash>
Oct 30 11:49:49 homeserver systemd-resolved[17681]: mDNS-IPv6: There appears to be another mDNS responder running, or previously systemd-resolved crash>
Oct 30 11:49:49 homeserver systemd[1]: Started systemd-resolved.service - Network Name Resolution.

but even if I stop the container and restart the server, I still can't see homeserver.local so I don't think it is just home assistant, it's gotta be something else at play here, too. It also can't be avahi as it is not even installed

I'm running Ubuntu Server 24 (Linux homeserver 6.8.0-47-generic #47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux)

Edit

I managed to get enp3s0 mDNS up with the following: added /etc/systemd/system/multicast-dns.service with this content

[Unit]
Description=Enable MulticastDNS on enp3s0 network link
After=network-online.target systemd-resolved.service

[Service] ExecStart=resolvectl mdns enp3s0 yes

[Install] WantedBy=multi-user.target

and then sudo systemctl enable multicast-dns

but this feels like a hack and doesn't make any sense at all since the files recommended by every other article and the documentation are there

Luiz K.
  • 145

1 Answers1

2

For mDNS to be enabled on a link, it has to be enabled both per link and globally. This feature was added in Systemd version 234. See here.

It appears that you already have it enabled globally, but to be thorough, enable it globally by editing /etc/systemd/resolved.conf and set the following:

[Resolve]
...
MulticastDNS=yes
...

Your post indicates that you created the file, /run/systemd/network/10-netplan-enp3s0.network.d/override.conf. But files in /run/systemd/network/ are ephemeral and created by Netplan at each boot. Therefore, you need to create an override file in /etc/systemd/network instead.

Start by determining the name of the main network file:

$ ls /run/systemd/network
10-netplan-enp3s0.network

Create the drop-in directory based on the name of the main network file:

$ mkdir /etc/systemd/network/10-netplan-enp3s0.network.d

Create a drop-in file: /etc/systemd/network/10-netplan-enp3s0.network.d/override.conf with the following:

[Network]
MulticastDNS=yes

Reboot your computer and verify.

$ resolvectl mdns
Global: yes
Link 2 (enp3s0): yes
mpboden
  • 3,046