Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setup avahi-daemon on Ubuntu for so you can reach hostname `ubuntu.local` from host OS
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
@davidhbrown-uri

This comment has been minimized.

Copy link

@davidhbrown-uri davidhbrown-uri commented Jul 22, 2018

thank you :-)

@nerdinand

This comment has been minimized.

Copy link

@nerdinand nerdinand commented May 6, 2019

sudo apt-get install avahi-daemon seems to be enough to make your Ubuntu Server 18.04 accessible as ubuntu.local.

@icedawn

This comment has been minimized.

Copy link

@icedawn icedawn commented Jul 4, 2020

Confirmed that sudo systemctl restart avahi-daemon is sufficient. Note that, because of my network, this wasn't sufficient to get my Jetson nano's online and discoverable in the .local domain. In order to get this to work, I had to disable AVAHI_DAEMON_DETECT_LOCAL in /etc/default/avahi-daemon.

# 1 = Try to detect unicast dns servers that serve .local and disable avahi in
# that case, 0 = Don't try to detect .local unicast dns servers, can cause
# troubles on misconfigured networks
AVAHI_DAEMON_DETECT_LOCAL=0

It's recommended that you fix your network rather than disabling this detection, but if you are like me and are unable to do this for some reason, the above fix works. Just set it to zero and restart the daemon (or reboot) ... sudo systemctl restart avahi-daemon on Ubuntu 18.04.4 worked for me.

@ryanmaclean

This comment has been minimized.

Copy link

@ryanmaclean ryanmaclean commented Nov 21, 2020

Also chiming in here, sudo apt install -y avahi-daemon was all that was needed on Ubuntu 20.04 on (AMD/ARM)64.
Now Raspberry Pi 3 + 4 devices, desktops and servers on the network can be contacted via hostname.local addresses ♥️

@zigmoo

This comment has been minimized.

Copy link

@zigmoo zigmoo commented Jan 27, 2021

Also chiming in here, sudo apt install -y avahi-daemon was all that was needed on Ubuntu 20.04 on (AMD/ARM)64.
Now Raspberry Pi 3 + 4 devices, desktops and servers on the network can be contacted via hostname.local addresses ♥️

+1... works on my Pi4 as well

@GarethHards

This comment has been minimized.

Copy link

@GarethHards GarethHards commented Feb 3, 2021

how do i add domain names in avaho conf file or in XDG config file?please help me here

@Debdut

This comment has been minimized.

Copy link

@Debdut Debdut commented Feb 10, 2021

omg finally thanks 😊

@davidhbrown

This comment has been minimized.

Copy link

@davidhbrown davidhbrown commented Mar 16, 2021

Thanks also to the commenters, especially @ryanmaclean!

@azureology

This comment has been minimized.

Copy link

@azureology azureology commented Apr 19, 2021

If you only wish your host to be discoverable via hostname.loacl , then avahi-daemon is sufficient.
Once you want to resolve other client on local network using xxxx.local the rest of packages are still needed.

@mbratch

This comment has been minimized.

Copy link

@mbratch mbratch commented Jun 26, 2021

I'm not sure what's wrong on my Ubuntu system. avahi-browse -a shows my five local mDNS devices on the network by their host names. However, if I try avahi-resolve-host-name on any one of them it gives me a "Timeout reached". I'm unable to ping any of them. I've installed everything described in this thread, and I've tried the various settings. The behavior remains unchanged. Any thoughts what I may be missing?

@mikew

This comment has been minimized.

Copy link

@mikew mikew commented Jul 11, 2021

Once you want to resolve other client on local network using xxxx.local the rest of packages are still needed.

I don't think I've ever installed the rest of those packages, avahi-daemon alone has always let me ping and talk to other machines via their .local address. Just now on 20.10-server, even.

@mbratch

This comment has been minimized.

Copy link

@mbratch mbratch commented Jul 11, 2021

Once you want to resolve other client on local network using xxxx.local the rest of packages are still needed.

I don't think I've ever installed the rest of those packages, avahi-daemon alone has always let me ping and talk to other machines via their .local address. Just now on 20.10-server, even.

I wish mine worked as well in either case. Unfortunately, it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment