[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian and FQDN lookup



>> 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


Reply to: