Posts: 7
Joined: Tue Aug 29, 2017 9:31 pm

configuring avahi / mdns / bonjour / Zerconf

Wed Oct 04, 2017 7:19 pm

I have been busy trying to configure avahi and mdns to recognize .local addresses on the network.

I had some of the services figured out by just installing the avahi package through eopkg, this let me discover the devices that announced themselves in bonjour but not the ones that were using mdns, like other local computers. After some trial and error I figured I'd better share the whole process on how I got it all working.

By default Solus hasn't installed avahi, so let's install that first, this isn't very hard as it is in the repos.
[EDIT 06/10] atest version of Solus does have avahi installed by default[/edit]

Code: Select all

sudo eopkg it avahi
After having this installed you still need to activate the services

Code: Select all

sudo systemctl enable avahi-dnsconfd.service

Code: Select all

sudo systemctl enable avahi-daemon.service
all this is quite easy to find when looking around on the net.

Just to be sure I also restarted the services, although this is not strictly necessary

Code: Select all

sudo systemctl restart avahi-dnsconfd && sudo systemctl restart avahi-daemon
Now you are probably able to find all devices using bonjour only.

check by running

Code: Select all

avahi-browse -a
you should get some output like:

Code: Select all

+ enp38s0 IPv6 otherland                                     _ssh._tcp            local
+ enp38s0 IPv4 otherland                                     _ssh._tcp            local
+ enp38s0 IPv6 otherland                                     _sftp-ssh._tcp       local
+ enp38s0 IPv4 otherland                                     _sftp-ssh._tcp       local
+ enp38s0 IPv4 E941AB0A40B3@RaspberryPi                      _raop._tcp           local
+ enp38s0 IPv4 Pi-dev                                        _ssh._tcp            local
+ enp38s0 IPv4 50-35-10-70.1 Office                          _sleep-proxy._udp    local
+ enp38s0 IPv4 AsTV4HKjVs68ndwiIdpLDw@akLVyFEzX26BzlyzYIRKRw _acp-sync._tcp       local
The part that tripped me up for a while and also does trip me up when setting up mdns is the part with nss-mdns.

So first we have to install nss-mdns

first hit Ctrl+C to stop the avahi-browse process and then install nss-mdns

Code: Select all

sudo eopkg it nss-mdns
You still won't be able to reach all mdns services.

There is one more to thing to do.

We have to add the mdns part to the nsswitch config.

So let's do

Code: Select all

sudo nano /etc/nsswitch.conf
This should look like this on a standard Solus install

Code: Select all

 hosts: files dns
We are going to change this and add mdns_minimal [NOTFOUND=return] in between files and dns.

Code: Select all

hosts: files mdns_minimal [NOTFOUND=return] dns
Now everything should work and you should be able to find all your devices using Zeroconf with their hostname and adding .local.

To make sure that it works try pinging one of the other devices.

[Edit 2017/10/06: fixed some typo's]

Return to “Tutorials”