23

Running a server machine with CentOS 7, I've noticed that the avahi service is running by default.

I am kind of wondering what the purpose of it is.

One thing it seems to do (in my environment) is randomly disabling IPv6 connectivity, which looks like this in the logs:

Oct 20 12:23:29 example.org 
  avahi-daemon[779]: Withdrawing address record for fd00::1:2:3:4 on eno1
Oct 20 12:23:30 example.org
  Withdrawing address record for 2001:1:2:3:4:5:6:7
Oct 20 12:23:30 example.org
  Registering new address record for fe80::1:2:3:4 on eno1.*.

(the suffixes 1:2:3... are made up)

And indeed, after that the public 2001:1:2:3:4:5:6:7 IPv6 address is not accessible anymore.

Because of that I've disabled the avahi service via:

# systemctl disable avahi-daemon.socket avahi-daemon.service
# systemctl mask avahi-daemon.socket avahi-daemon.service
# systemctl stop avahi-daemon.socket avahi-daemon.service

So far I haven't noticed any limitations.

Thus, my question about the use-case(s) of avahi on a server system.

2 Answers 2

25

Avahi is the opensource implementation of Bonjour/Zeroconf.

excerpt - http://avahi.org/

Avahi is a system which facilitates service discovery on a local network via the mDNS/DNS-SD protocol suite. This enables you to plug your laptop or computer into a network and instantly be able to view other people who you can chat with, find printers to print to or find files being shared. Compatible technology is found in Apple MacOS X (branded ​Bonjour and sometimes Zeroconf).

A more detailed description is here along with the Wikipedia article. The ArchLinux article is more useful, specifying the types of services that can benefit from Avahi.

In the past I'd generally disable it on servers, since every server I've managed in the past was explicitly told about the various resources that it needed to access.

The two big benefits of Avahi are name resolution & finding printers, but on a server, in a managed environment, it's of little value.

4
  • I just wanted to comment on mainly the first answer: "... but on a server, in a manged environment, it's of little value.". The point of running avahi on a server is to have it announce its services to clients. It thereby makes perfect sense to have it on a server. But to actually receive server announcements you also need avahi on the client (unless it is a Mac). In general you also need clients that make use of avahi to find services. May 5, 2015 at 15:36
  • 4
    @TommySvensson, perhaps one has to differentiate between 'home-servers' (in a trusted network) and 'real' internet servers that host web sites, provide mail services etc. (in a kind of hostile environment). AFAIU, avahi is indented for home-network usage, i.e. where you don't even really can distinguish between client and server (i.e. where many service providing machines are also clients). Jun 29, 2015 at 10:02
  • 1
    @TommySvensson - In the data center setups I've dealt w/ over my career, the various communications that are allowed b/w one group of servers and another is tightly controlled (port @ host type connectivity) and so something such as Avahi would really serve no purpose, and would just not even be allowed to work given the restrictive nature of the communications that are permitted.
    – slm
    Jun 29, 2015 at 16:21
  • 2
    Seems useless and problematic. I always uninstall it. Not even gonna bother figuring out how to disable it.
    – sudo
    Jan 31, 2018 at 0:13
6

You may want to run the following

systemctl disable avahi-daemon.socket avahi-daemon.service 

Be aware though that the above will disable avahi only temporarily. To prevent automatic reenabling, it needs to be masked:

systemctl mask avahi-daemon.socket avahi-daemon.service 

Why, oh why do vendors build packages that force dependencies on avahi?

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .