>> and as far as I see it simply asks the DNS about the hostname using >> getaddrinfo. > > But, with stock nsswitch.conf, it issues uname(2) syscall first, goes > to /etc/hosts second, and if it encounters FQDN hostname - it all ends > here. > If /etc/hosts contain only bare hostname - it'd return a bare hostname. > > Only if /etc/hosts does not contain a hostname - a DNS search will be > performed (or other resolving method, all according to nsswitch.conf).
Yes, agree, though you will not see any of steps above if nscd is running as it was in my case. > >> On my system the "--fqdn" flag doesn't work if my /etc/resolv.conf >> doesn't have domain <mydomain> or search <mydomain> option enabled. > > Or it's because you have a bare hostname in /etc/hosts ;) It is because /etc/hosts had a wrong entry at the time I was testing it... Thank you for putting it all together. Alex -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/551d965f.70...@biotec.tu-dresden.de