On Tue 25 Jan 2022 at 13:06:49 +0100, Andrei POPESCU wrote:

> On Ma, 25 ian 22, 11:18:21, Brian wrote:
> > On Tue 25 Jan 2022 at 09:31:57 +0100, Andrei POPESCU wrote:
> > > 
> > > Could you point to any (reasonably up-to-date) documentation or is it 
> > > sufficient to just install avahi-daemon and libnss-mdns?
> > 
> > 'apt install avahi-daemon' is sufficient. libnnss-mdns is a recommended
> > package of avahi-daemon. Machines with cups installed will already have
> > both packages. Documentation is at
> > 
> >   https://www.avahi.org/
> >   https://github.com/lathiat/nss-mdns
> > 
> > and in /usr/share/doc.
> >  
> > > Can mDNS resolve only hostnames or is it necessary to always mention the 
> > > '.local' domain?
> > 
> > .local is required.
> 
> Less than optimal (yes, I'm lazy), but I might be able to live with it ;)

It grows on you :).
 
> Is there a way to have "generic" names, e.g. something like "mpd.local", 
> independent of the system's hostname?

Let's see if this addresses your question:

Install avahi-utils. For a complete view of the network, do

  avahi-browse -art | less

For a spcific service, do

  avahi-browse -rt _mpd._tcp

on the same or another machine. _mpd._tcp is a service name and is
"something like "mpd.local"".

(BTW, I had to disable and mask mpd.socket for the commands to give
outputs for mpd).

> I like to name systems based on their hardware, not based on the 
> service(s) they provide.
> 
> If for some reason I want to move the mpd service from one system to 
> another, how can I do that without having to reconfigure all clients?

Relocation on the same network should not need client reconfiguration.

> My current solution is to point something like mpd.(mylocaldomain) to 
> the correct IP address in the router (OpenWrt) and use that in all 
> clients[1]. If I need to move the service to another system I only need 
> to adjust the configuration in one place.
> 
> 
> (I'm aware mpd might not be the best example here, since as far as I 
> know it has native zeroconf support, but let's just assume clients are 
> either buggy or lack zeroconf support completely. Besides, this would 
> apply also to services without zeroconf support.)

I'm a little lost here. If services or clients lack Avahi integration,
they cannot avail themselves of its services.

-- 
Brian.

Reply via email to