In the current baselayout there is now a conf.d file called "domainname" and users are encouraged to set their domainname in here and not in /etc/dnsdomainname. The new init.d script for domainname checks the new /etc/conf.d/domainname file and if it finds a DOMAINANAME set it then parses the /etc/resolv.conf file, removes the existing 'domain' entry and adds a new 'domain' to the end of the file. This causes resolution issues (certainly with the current BIND code SFAIK) in that if the users machine has a 'search' string in resolv.conf the 'domain' string must come first, or resolution based on incomplete hostnames will break. Thus, in my case, on many servers, the new /etc/init.d/domainname script causes my resolv.conf file to be invalid and make lots of script that use incomplete hostnames (I know thats bad form, I'm sorry, but it should still work) to fail to reolve the hostname. If I edit resolve.conf to move the 'domain' line from the end of the file to the top of the file, everything works again... until I reboot and then have to edit resolv.conf again. Reproducible: Always Steps to Reproduce: 1. edit /etc/conf.d/domainname to have a DOMAINNAME 2. put a 'search' variable in your resolv.conf above your 'nameservers' 3. reboot Actual Results: Hostname resolution on partial hostnames fails. Expected Results: The 'domain' line in /etc/resolv.conf needs to be added to the top of the /etc/resolv.conf file, not the end. Or, better yet, if the domain is the same, just leave the file alone :-) flossie ~ # emerge info Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.4. 20041102-r1, 2.6.12-gentoo-r4 i686) ================================================================= System uname: 2.6.12-gentoo-r4 i686 Intel(R) Xeon(TM) CPU 2.40GHz Gentoo Base System version 1.6.12 dev-lang/python: 2.2.3-r1, 2.3.5 sys-apps/sandbox: 1.2.10 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.4.19-r1, 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/ config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -march=pentium4 -funroll-loops -fprefetch-loop-arrays -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://www.mirror.ac.uk/mirror/distro.ibiblio.org/pub/linux/dist ributions/gentoo/" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 apm arts avi berkdb bitmap-fonts cdr crypt cups emboss encode fam fooma ticdb fortran gdbm gif gpm gtk2 imagemagick imlib ipv6 jpeg libg++ libwww mad mi kmod motif mp3 mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png postgre s python qt quicktime readline samba slang spell ssl tcpd tiff truetype truetype -fonts type1-fonts xml2 xmms xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS
that's the point of the OVERRIDE variable really the only point of setting your domainname is to auto-modify resolv.conf so if you dont want resolv.conf to be touched at all, you shouldnt set the DOMAINNAME variable
*** Bug 99806 has been marked as a duplicate of this bug. ***
Perhaps there should be a comment in /etc/conf.d/domainname that you must set OVERRIDE=0 otherwise your search domains will not work. Another option would be to add the "domain" directive to the top of the file, instead of the bottom of the file, so it won't unnecessarily override the search domains. Since turning on the domainname service is part of the Gentoo base install procedure, it seems like some step should be taken to avoid breaking people's search domains.