Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 70690

Summary: baselayout-1.11.5: /etc/init.d/domainname breaks resolv.conf
Product: Gentoo Linux Reporter: Ulrich Müller <ulm>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED WONTFIX    
Severity: major CC: distler, pasky, scottfk
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Ulrich Müller gentoo-dev 2004-11-10 10:59:50 UTC
The "domainname" init script puts a "domain" option line at the end of
resolv.conf, in spite of the "search" keyword being present in that file.
Until (at least) baselayout-1.10.4 the "domain" line used to go to the
beginning of the file.

The new version makes it impossible to use the "search" option, since
the last instance of any "domain" and "search" options is taken. See
resolver(5).

(Also, I cannot find any ChangeLog entry about this change.)
Comment 1 SpanKY gentoo-dev 2004-11-10 14:25:33 UTC
it's in the ChangeLog, read harder

if you dont like the domainname script overriding local 'search' options, remove it from your boot (`rc-update del domainname`)
Comment 2 Ulrich Müller gentoo-dev 2004-11-10 16:06:29 UTC
Found the ChangeLog entry (sorry about that) and also bug 48277. Removing
domainname from boot is not an option since it is needed to set the
NIS domainname.

I still do not see what is the point in adding the domain option at the end
of the file since the awk script in domainname removes all lines starting
with "domain". So putting it at the end just breaks the search option:

| The domain and search keywords are mutually exclusive.  If
| more  than  one instance of these keywords is present, the
| last instance wins.
Comment 3 Ulrich Müller gentoo-dev 2004-11-10 16:14:54 UTC
Maybe I should add that /usr/bin/host still works if "search" is before "domain",
but /bin/ping and /usr/bin/ssh will fail ("unknown host").
Comment 4 SpanKY gentoo-dev 2004-11-10 16:19:25 UTC
then just run `rm /etc/dnsdomainname`

as for ssh/ping vs host ... the bind-tools implement their own resolver library while ssh/ping use the glibc one
Comment 5 Ulrich Müller gentoo-dev 2004-11-10 23:39:44 UTC
If you really want the "domain" option to take precedence then you should
be consequent and strip all "search" options from the file. To leave these
unused lines in resolv.conf is only confusing.
Comment 6 SpanKY gentoo-dev 2004-11-12 21:55:01 UTC
just talked with azarah and he pointed how our 3 config files in /etc/ (hostname / dnsdomainname / nisdomainname) are completely Gentoo specific

i'll look at updating the scripts to use conf.d files and in the meantime add a config option to domainname to be a little more user friendly ... not everyone realizes how resolv.conf / domainname works and how using the domainname script is wrong if you want to manage your own resolv.conf
Comment 7 scott 2005-06-28 15:12:00 UTC
*** Bug 97323 has been marked as a duplicate of this bug. ***