#511422 resolv.conf(5): somes errors about domain and search

Package:
manpages
Source:
manpages
Submitter:
Christoph Anton Mitterer
Date:
2015-03-08 19:45:18 UTC
Severity:
normal
#511422#5
Date:
2009-01-10 18:33:48 UTC
From:
To:
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.

#511422#10
Date:
2009-01-12 23:12:14 UTC
From:
To:
Hello Christoph,

Support for this claim (ecxamples, tests) would make this report more useful.

See above.

Cheers,

Michael

#511422#15
Date:
2009-02-01 02:39:33 UTC
From:
To:
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.

#511422#22
Date:
2012-10-23 22:29:46 UTC
From:
To:
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.

#511422#29
Date:
2012-10-25 01:09:31 UTC
From:
To:
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.

#511422#34
Date:
2012-10-25 20:26:46 UTC
From:
To:
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.