Install Avahi
sudo apt install avahi-daemon
Start and enable the service
sudo systemctl enable --now avahi-daemon
The hostname defined on /etc/hostname will be available in the local network using the .local extension.
After applying changes in the hostname:
sudo systemctl restart systemd-hostnamed
If the output of resolvectl status is -mDNS instead of +mDNS, modify /etc/systemd/resolved.conf and add:
[Resolve]
MulticastDNS=yes
LLMNR=yes
Restart the service sudo systemctl restart systemd-resolved and check again resolvectl status
Check the firewall configuration: sudo firewall-cmd --permanent --add-service=mdns
linux net