mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] MDNS using avahi2dns
@ 2023-12-11 20:47 Rafael Ávila de Espíndola
  2023-12-11 23:17 ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael Ávila de Espíndola @ 2023-12-11 20:47 UTC (permalink / raw)
  To: musl

Hi,

I am trying to hack together
https://wiki.musl-libc.org/future-ideas.html#mDNS-and-alternate-hostname-database-backends.

The hard part is done by https://github.com/LouisBrunner/avahi2dns,
which will use avahi to resolve .local domains. With it running,
commands like

$ dig @192.168.1.1 printer0032DB24.local

will work.

In my laptop I was able to just have

nameserver 127.0.0.1
nameserver 196.168.1.1

in /etc/resolv.conf, but I realize now that it worked only because wifi
was relatively slow. On my desktop, using ethernet, the router answer
sometimes comes first and name resolution fails.

I will try setting up a local unbound next and configure it to forward
to avahi2dns for .local and the DHCP provided server for everything
else.

I just wanted to check if musl doesn't have the support to selectively
forward to different name servers.

Thanks,
Rafael

P.S.: I am not subscribed to the list.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [musl] MDNS using avahi2dns
  2023-12-11 20:47 [musl] MDNS using avahi2dns Rafael Ávila de Espíndola
@ 2023-12-11 23:17 ` Rich Felker
  2023-12-17 21:11   ` Rafael Ávila de Espíndola
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2023-12-11 23:17 UTC (permalink / raw)
  To: Rafael Ávila de Espíndola; +Cc: musl

On Mon, Dec 11, 2023 at 07:47:36PM -0100, Rafael Ávila de Espíndola wrote:
> Hi,
> 
> I am trying to hack together
> https://wiki.musl-libc.org/future-ideas.html#mDNS-and-alternate-hostname-database-backends.
> 
> The hard part is done by https://github.com/LouisBrunner/avahi2dns,
> which will use avahi to resolve .local domains. With it running,
> commands like
> 
> $ dig @192.168.1.1 printer0032DB24.local
> 
> will work.
> 
> In my laptop I was able to just have
> 
> nameserver 127.0.0.1
> nameserver 196.168.1.1
> 
> in /etc/resolv.conf, but I realize now that it worked only because wifi
> was relatively slow. On my desktop, using ethernet, the router answer
> sometimes comes first and name resolution fails.
> 
> I will try setting up a local unbound next and configure it to forward
> to avahi2dns for .local and the DHCP provided server for everything
> else.
> 
> I just wanted to check if musl doesn't have the support to selectively
> forward to different name servers.

Indeed, the officially supported way to do alternative name backends,
unioning of multiple name sources, etc. is pointing resolv.conf at a
program speaking DNS protocol and doing whatever logic you want.

Whenever resolv.conf has multiple nameservers listed, musl's resolver
expects them to be redundant sources for a common namespace. In theory
this *can* give you unioning if each one responds with ServFail
(inconclusive) or not at all for names outside of its jurisdiction,
but if one responds with NxDomain or NODATA, that will be conclusive
and preclude seeing a positive result from the other. The only
consistent way to avoid this would be waiting for responses from all
the nameservers to pick what to do, but that's generally very slow and
contrary to normal intent to use redundancy to get resilience against
outage of one or more nameservers.

If you put together a configuration for unioning .local from avahi and
want to share it here or on the wiki (or anywhere else), that might be
something other users would like and benefit from too.

Rich

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [musl] MDNS using avahi2dns
  2023-12-11 23:17 ` Rich Felker
@ 2023-12-17 21:11   ` Rafael Ávila de Espíndola
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael Ávila de Espíndola @ 2023-12-17 21:11 UTC (permalink / raw)
  To: Rich Felker; +Cc: musl

> If you put together a configuration for unioning .local from avahi and
> want to share it here or on the wiki (or anywhere else), that might be
> something other users would like and benefit from too.

I have created https://wiki.alpinelinux.org/wiki/MDNS with what I have
so far.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-18 18:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11 20:47 [musl] MDNS using avahi2dns Rafael Ávila de Espíndola
2023-12-11 23:17 ` Rich Felker
2023-12-17 21:11   ` Rafael Ávila de Espíndola

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).