avahi icon indicating copy to clipboard operation
avahi copied to clipboard

Update avahi-resolve and avahi-browse to support a mode to force lookup over mdns only

Open bigbighd604 opened this issue 1 year ago • 4 comments

As https://github.com/avahi/avahi/pull/556 discussed, the current avahi-resolve doesn't support a mode to allow a mdns only reverse lookup, when enable-wide-area=yes, the following command will give non mDNS result, which is confusing.

$ avahi-resolve -a 10.0.0.246
MBP.hsd1.or.comcast.net

And this mdns only mode might apply to avahi-resolve -n too.

bigbighd604 avatar Feb 05 '24 21:02 bigbighd604

It would certainly help, if command line flags were available for setting this. Especially when we have two ways to resolve the same address, without obvious definition which should be used for which addresses. We can safely assume link-local addresses should be resolved via multicast only, but for other addresses that is not so easy.

Altough there are other calls to resolve reverse address, such as getent hosts 10.0.0.246, which might be preferred for general reverse queries. This should be relatively simple feature, setting next release milestone.

pemensik avatar Feb 06 '24 17:02 pemensik

avahi-browse should probably support that too: https://github.com/avahi/avahi/issues/172#issuecomment-1971661630.

More generally I think wide-area should be off by default in https://github.com/avahi/avahi/blob/master/avahi-daemon/avahi-daemon.conf. It's already turned off in some packages to judge from https://github.com/search?q=%22enable-wide-area%3Dno%22&type=code but large distros appear to take the avahi config directly (probably because of the misleading documentation saying that it's off by default)

evverx avatar Mar 01 '24 00:03 evverx

@pemensik are you OK with commenting out enable-wide-area= in https://github.com/avahi/avahi/blob/master/avahi-daemon/avahi-daemon.conf? I can send a PR. It would be great to flip it before the release and mention it in the release notes. In its current form it interacts weirdly with mDNS and has various issues where it supports 512 bytes only, can't switch to TCP, all the queries are always sent from the same UDP port and so on.

evverx avatar Mar 02 '24 06:03 evverx

I flipped it in https://github.com/avahi/avahi/commit/9c4214146738146e454f098264690e8e884c39bd.

evverx avatar Mar 04 '24 14:03 evverx