Enable mDNS to Ubuntu Server

Enable mDNS to Ubuntu Server

What exactly is mDNS? Well, it allows for accessing your local network by hostnames, instead of IP addresses, without the need for a DNS setup

Here’s how to set it up (Ubuntu 24.x)

Check whether Global mDNS is set. You can do that just by running resolvectl

$ resolvectl mdns
Global: no
Link 2 (eno1): no

If it says no, then there are two steps – enable mDNS globally, and then to the interface. To enable globally edit /etc/systemd/resolved.conf to say

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

Note: Remove the # at the start of the entry!

Now determine the interface configuration

$ ls /run/systemd/network
10-netplan-enp0s8.network <-------

Now we need to create a directory and add in the override options – so first the directory

mkdir /etc/systemd/network/10-netplan-enp0s8.network.d/

And then the file

vi /etc/systemd/network/10-netplan-enp0s8.network.d/override.conf

Populate the file with

[Network]
MulticastDNS=yes

Reboot the machine. It should now be available on the network with the .local extension

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *