Hey.. On Wed, 2012-10-24 at 00:29 +0200, Simon Paillard wrote: > (some years after) Let me see what I meant back then, as this is so long ago ;)
> It does work: > # hostname > toshi ok so I guess you have set something like <local ip> toshi.debian.org toshi in /etc/hosts and hostname -f would result in: toshi.debian.org Therefore, from what the manpage says: "If no domain entry is present, the domain is determined from the local hostname returned by gethostname(2)" I would assume that "domain" is implicitly set to "debian.org", right? > # getent hosts www-master > (nothing) Ok but if the above is true (and because www-master is below debian.org), I'd have expected this to work. > # hostname toshi.debian.org > # getent hosts www-master > 206.12.19.116 www-master.debian.org Ok.. but a) Isn't that "wrong", I mean setting the hostname to the FQDN?! b) It's a bit confusing, cause when you read e.g. hostname(1) it says it also uses gethostname(2) to determine the domain from the (short) hostname, right? So it goes effectively via /etc/hosts . But the "domain" from resolv.conf, where the manpage claims to use the same function... does then not determine the domain via that. > Actually, according to glibc/resolv/res_init.c (search for _PATH_RESCONF): > * the first domain listed after 'search' keyword the considered the default > domain (same as 'domain'). > * as whatever is 'domain' or 'search' keyword, the default domain is > overwritten, the last seen keyword applies. > > I don't know is this is a libc bug / should be documented in manpages. Not sure whether I understand what you mean: Imagine I have: domain example.com search example.org example.net All domains have a host "host.example.XXX". Now the order of the domains in the search directive is more or less clear, I guess (because the manpage says: "will be attempted using each component of the search path in turn until a match is found"): first .org, then .net Well I guess the text could be made even clearer by saying something like "checking for a match in order of the listed domains" or so... But from your text above (and neither from the manpage) I understand now, what getent hosts host would give? I.e., is example.com not longer used at all (overridden by the "search" list) or is it tried first, or after example.net. > > The most options in hosts.conf seem to be ignored,.. can you update this? > Do you mean host.conf ? > I don't understand what is your point. Yeah... what did I mean back then? ^^ I don't know anymore, sorry... It seems as if some of these options are no longer used (in the sense of they are deprecated or so)... right? Perhaps I meant that. e.g. AFAIU "order" is nowadays controlled by nsswitch.conf. I vaguely remember that people were also discouraged from using any of the *spoof* options... but I may also be mistaken here. Anyway, currently, I have no idea why I thought they were really _ignored_. But if some of them are discouraged to be used (as maybe with the *spoof*) or superseded by others (as maybe with *order*)... one should perhaps place pointers/description to what should be done nowadays. Cheers, Chris.
smime.p7s
Description: S/MIME cryptographic signature