Rich Freeman via plug on 8 Dec 2020 14:20:00 -0800 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: [PLUG] Defaulting the domain for a name lookup |
On Tue, Dec 8, 2020 at 4:46 PM brent timothy saner via plug <plug@lists.phillylinux.org> wrote: > > On 12/8/20 14:17, Rich Freeman via plug wrote: > > > > Interesting, I'd think that this should cause applications to search > > mybands.local automatically. I thought that was more a glibc thing > > than a DNS thing. But I haven't looked into that. > > It's technically closer to a DHCP/DHCP6/RA thing, but it's not a glibc > thing exclusively. It's implemented in all the major OSes. > Sure, but I meant the implementation of DNS domain searching on linux is done in glibc based on the contents of resolv.conf. That is, when you call gethostbyname with just a hostname, glibc will try the various search domains in successive DNS queries until it gets a hit. The DNS server usually doesn't know anything about search domains in resolv.conf and just resolves FQDNs. Now, if the DNS server is systemd-resolved then it can be told to implement its own search domains - I'm not sure exactly how this works. Getting back to mDNS - I think the behavior if you use .local with DNS might depend on your nsswitch.conf setup. However, if this is not allowing .local to be resolved via DNS then I'd expect that behavior to apply even if you used a FQDN. If you do a ping hostname.local and it checks mDNS before DNS and has a notfound=return behavior, then if mDNS can't find the host it you should get a host not found even if the default DNS server knows about it because it won't get that far. I'd need to spend more time reading to figure out exactly what is going on here... -- Rich ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug