Hi. On Thu, 02 Apr 2015 14:54:19 +0200 Alex Mestiashvili <a...@biotec.tu-dresden.de> wrote:
> the mechanism is described here: > > http://sources.debian.net/src/hostname/3.15/hostname.c/ > > 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). > 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 ;) > You can see it with strace hostname --fqdn. All this invaluable information above was provided you by strace :) Reco -- 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/20150402193119.cba12c779df50ae576558...@gmail.com