No Fuss Local Device Names in Arch
Many operating systems, including most Linux distributions, configure devices to have a hostname like device.local
accessible on the local network. The way this works is via a protocol called mDNS
or Multicast DNS.
Arch doesn't set it up by default. To enable it, you only need to enable it in systemd-resolved:
-
Uncomment a section in
/etc/systemd/resolved.conf
MulticastDNS=yes
-
And then restart systemd-resolved
$ sudo systemctl restart systemd-resolved
-
Make sure it's enabled permanently
$ sudo systemctl enable --now systemd-resolved
After that, you will be able to locate other machines using mDNS
on your network with the address hostname.local
.
I was setting up another Arch install this weekend and couldn't remember how to do this. I had to dig it out of some chat logs, so I thought it would be best to immoratlize this tip on my blog. For myself, and for you.