| Size: 1482 Comment:  | Size: 1884 Comment:  | 
| Deletions are marked like this. | Additions are marked like this. | 
| Line 3: | Line 3: | 
| '''Avahi''' is an implementation of '''Zeroconf''', the zero-configuration method for network services. This would otherwise be accomplished through local DNS resolution. | '''Avahi''' is an implementation of Zeroconf and mDNS. | 
| Line 5: | Line 5: | 
| Associated executables are tools including `avahi-browse` and `avahi-discover`. The primary functionality is a service, accessed in `systemd` as `avahi-daemon.service`. | The project began with Lennart Poettering's implementation of mDNS and DNS-SD. <<TableOfContents>> | 
| Line 11: | Line 13: | 
| == Accessing Local Services == | == Installation == | 
| Line 13: | Line 15: | 
| To make use of the "hostname.local" name resolution, an additional dependency (commonly named `nss-mdns`) is required. | Most Linux distributions offer an `avahi` package. For BSD distributions, try `avahi-daemon`. For `systemd`-capable systems, [[Linux/Systemd|start and enable]] `avahi-daemon.service`. The daemon binary is named `avahi-daemon(8)`. ---- == Configuration == [[Linux/SystemdNetworkd|networkd]] has a competing mDNS implementation that will need to be disabled before `avahi` can be made to work. Alternatively, [[Linux/Systemd|disable]] `systemd-resolved.service` entirely. === Name Resolution === For Avahi to insert domain name resolution for discovered services, an additional dependency (commonly named `nss-mdns`) is required. | 
| Line 21: | Line 43: | 
| More powerful configurations are of course possible, but this is the simplest and most minimal one. | |
| Line 23: | Line 44: | 
| You should be able to discover local services now. Try: | |
| Line 25: | Line 45: | 
| {{{ avahi-browse --all }}} | === Firewalls === `avahi-daemon(8)` binds to port 5353. Firewalls such as [[Ufw|ufw]] or [[Awall|awall]] must be reconfigured to open it. | 
| Line 33: | Line 53: | 
| == Hosting Services == | == Usage == | 
| Line 35: | Line 55: | 
| Avahi uses all `/etc/avahi/services/*.service` files that are readable by the `avahi` user and group. These take the form of structured XML. For example, an FTP service: | === Advertising Services === `avahi-daemon(8)` uses all `/etc/avahi/services/*.service` files that are readable by the `avahi` user and group. These take the form of structured XML. For example, an FTP service: | 
| Line 49: | Line 71: | 
| Also, Avahi broadcasts over port 5353. See details in [[UFWSetup|the article for UFW setup]]. | === Discovery === In a terminal, use `avahi-browse(1)`. {{{ avahi-browse --all }}} Alternatively there is the graphical client `avahi-discover(1)`. | 
Avahi
Avahi is an implementation of Zeroconf and mDNS.
The project began with Lennart Poettering's implementation of mDNS and DNS-SD.
Contents
Installation
Most Linux distributions offer an avahi package. For BSD distributions, try avahi-daemon.
For systemd-capable systems, start and enable avahi-daemon.service.
The daemon binary is named avahi-daemon(8).
Configuration
networkd has a competing mDNS implementation that will need to be disabled before avahi can be made to work.
Alternatively, disable systemd-resolved.service entirely.
Name Resolution
For Avahi to insert domain name resolution for discovered services, an additional dependency (commonly named nss-mdns) is required.
Insert mdns_minimal [NOTFOUND=return] into /etc/nsswitch.conf, as below.
hosts: files mymachines myhostname mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] dns
Firewalls
avahi-daemon(8) binds to port 5353. Firewalls such as ufw or awall must be reconfigured to open it.
Usage
Advertising Services
avahi-daemon(8) uses all /etc/avahi/services/*.service files that are readable by the avahi user and group. These take the form of structured XML. For example, an FTP service:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name>FTP</name>
  <service>
    <type>_ftp._tcp</type>
    <port>21</port>
  </service>
</service-group>
Discovery
In a terminal, use avahi-browse(1).
avahi-browse --all
Alternatively there is the graphical client avahi-discover(1).
