On Wed, Feb 15, 2023 at 08:34:49AM -0500, Michael Stone wrote: > On Wed, Feb 15, 2023 at 07:30:44AM -0500, Greg Wooledge wrote: > > That said, I'm curious about this part oF Gene's result: > > > > > > gene@bpi54:~$ grep -i bpi54 /etc/hosts > > > > 192.168.71.12 bpi54.coyote.den bpi54 > > > > gene@bpi54:~$ getent hosts bpi54 > > > > fe80::4765:bca4:565d:3c6 bpi54 > > > > Where does getent pull that IPv6 address from? That's not what I get > > when I look myself up: > > probably mymachines, which is yet another new twist to add to this already > ridiculous saga
OK, that sounds like a reasonable guess. Here's what I've managed to track down so far: The Debian (and apparently Armbian) packages libnss-mymachines and libnss-myhostname are part of systemd. It was easier for me to find their source code than their documentation. Source code for mymachines is at https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/src/nss-mymachines/nss-mymachines.c And for myhostname, https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/src/nss-myhostname/nss-myhostname.c I couldn't glean much from nss-mymachines.c because mostly what it seems to do is send messages to other systemd services, and act upon the responses. I didn't try to track down what those other services do. By going to packages.debian.org and looking at the package lists for these things, I was able to learn what the man pages are called. https://manpages.debian.org/bullseye/libnss-myhostname/nss-myhostname.8.en.html https://manpages.debian.org/bullseye/libnss-mymachines/nss-mymachines.8.en.html I can't imagine how an end user is supposed to guess that the man page is named after the source code's *.c filename, rather than the package name, or the package name without "libnss-". I guess that if you actually had these things *installed* you could track them down with "man -k" or "apropos" or "dpkg -L libnss-myhostname | grep man" or something, but I don't have them installed, so those options are closed off for me. Anyway, based on those man pages, I concur that it's quite likely Gene's answer to "getent hosts bpi54" came from libnss-myhostname. ============================= The part I still don't understand is how adding "search files, nameserver" to /etc/resolv.conf and rebooting could change the behavior of any of Gene's commands. In my own testing, it appears that the comma is ignored. When I put search wooledge.org, gene in mine, it acts as if I had put search wooledge.org gene which is pretty reasonable, I suppose. So, we can reduce Gene's line to: search files nameserver which should mean that when Gene types "ping coyote", and "coyote" is not present in /etc/hosts, name resolution should look for "coyote.files" and "coyote.nameserver" before giving up. The surprising part is that apparently one of these names *works*. Maybe? I don't know if we ever saw the output of "ping coyote" on Gene's machine when it was in the "working" state. If one of the nss-my* modules is creating resolvable entries for one of those names, it would explain the behavior Gene is seeing. But I can't find anything in the documentation to indicate they would do that. So, I'm still rather confused.