The resolv.conf manpage says that defaults for domain and search are generated when not specified... however it seems that this is simply not the case. The thing with "the root domain is assumed" might be wrong, too. What is the priority if you specify both domain and search? And therse should be better documentation about the actual difference between that two. The most options in hosts.conf seem to be ignored,.. can you update this? Thanks, Chris ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Hello Christoph, Support for this claim (ecxamples, tests) would make this report more useful. See above. Cheers, Michael
Hi Michael. Sorry for that ultra long delay ;) We have the following here: A host lcg-lrz-se.lrz-muenchen.de . When I set either: domain lrz-muenchen.de or search lrz-muenchen.de or both, a ping lcg-lrz-se works and uses lcg-lrz-se.lrz-muenchen.de But when I set neither of them the same ping doesn't resolve the hostname. Thus I assume that what the manpage states: "If no domain entry is present, the domain is determined from the local hostname returned by gethostname(2)" and/or "The search list is normally determined from the local domain name" is not true. btw: That "The search list is normally determined from the local domain name" for the search keyword,... what does it refer to? The "local domain name" set via the domain keyword in resolv.conf? Ok I'll take this one back. Thanks, Chris.
Hi, (some years after) # hostname toshi # getent hosts www-master (nothing) # hostname toshi.debian.org # getent hosts www-master 206.12.19.116 www-master.debian.org * 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. Do you mean host.conf ? I don't understand what is your point.
Hey.. Let me see what I meant back then, as this is so long ago ;) 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? Ok but if the above is true (and because www-master is below debian.org), I'd have expected this to work. 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. 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. 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.
No, why do you guess that ? (and anyway, the subject is not /etc/hosts parsing)
man hostname:
GET NAME
When called without any arguments, the program displays the current names:
hostname will print the name of the system as returned by the gethostname(2) function.
So there is no problem regarding this point.
example.org will be set as the default domain, then it will search in
example.net.
example.com will not be used at all.
example.com would be the default domain (and example.org ignored) if:
search example.org example.net
domain example.com
I'll try to review hosts.conf later.
If you already have concrete examples / tests, don't hesitate to report a
separate bug.