Ticket #273 (closed defect: wontfix)

Opened 4 years ago

Last modified 3 years ago

No unicast resolution if avahi is started before network is configured

Reported by: jwelsh Owned by: lennart
Milestone: Avahi 0.6.26 Component: avahi-daemon
Keywords: Cc:

Description

If avahi-daemon starts before /etc/resolv.conf is configured by dhcp, it will not resolve any requests via unicast DNS (e.g. for wide-area DNS-SD). If I do avahi-daemon -r it will reload resolv.conf (via the chroot helper I assume) and succeed. Perhaps resolv.conf could be added to the inotify watch list?

I'm using gentoo and avahi-daemon is usually started before DHCP is acquired. On Debian it seems ok normally but I can reproduce by ifdown / restart avahi / ifup.

I'd imagine this is a worse problem for laptops using networkmanager or some such.

Change History

Changed 4 years ago by lennart

It's a bit hard to do that, since we'd have to watch all of /etc and Avahi itself is chrooted to /etc/avahi. Not sure if it would be worth making this possible.

Changed 4 years ago by jwelsh

My impression was that inotify allowed watching of individual files, but if not, then indeed that's not very clean.

But, doesn't avahi detect changes in network interfaces/addresses? i.e. it reports "Joining mDNS multicast group on interface eth0.IPv4 with address xxxx" when that interface comes up. Would that be a suitable trigger for reloading? Perhaps only if there were no nameservers before.

Changed 3 years ago by lennart

  • status changed from new to closed
  • resolution set to wontfix
  • milestone set to Avahi 0.6.26

Usually the network interface is brought up before resolv.conf is changed, such a logic would hence be race.

If we wanted to use inotify we'd have to watch /etc itself, since resolv.conf is usually not rewritten, but moved away and created anew. This is not really scalable and ugly too.

I think the best way is to change software that rewrites resolv.conf to send a SIGHUP to avahi-daemon. Or use a local DNS cache such as dnsmasq.

Note: See TracTickets for help on using tickets.