Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22275 - system domainname is never set
Summary: system domainname is never set
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-05 08:18 UTC by Alexander Papaspyrou
Modified: 2003-07-19 22:48 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for agetty (agetty.c.patch,1.30 KB, patch)
2003-07-12 19:31 UTC, Marius Mauch (RETIRED)
Details | Diff
Patch for agetty manpage (agetty.man.patch,425 bytes, patch)
2003-07-12 19:32 UTC, Marius Mauch (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Papaspyrou 2003-06-05 08:18:24 UTC
Although the /etc/init.d/hostname script correctly sets up the hostname of a machine, 
the domainname (neither nis nor dns) isn't set at any time and thus reported 
incorrectly. 
 
	# hostname 
	localhost 
	# domainname 
	(none) 
 
which is *really b0rked. 

Reproducible: Always
Steps to Reproduce:
1. install Gentoo Linux according to the Installation Guide (x86) 
2. run /bin/hostname 
3. run /bin/domainname 
Actual Results:  
shell excerpt: 
--8<-- snip --8<-- 
# /bin/hostname 
myhost 
# /bin/domainname 
(none) 
-->8-- snap -->8-- 

Expected Results:  
shell excerpt: 
--8<-- snip --8<-- 
# /bin/hostname 
myhost 
# /bin/domainname 
mydomain.mytld 
-->8-- snap -->8-- 

user@host $ emerge info 
Portage 2.0.48 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4) 
================================================================= 
System uname: 2.4.20-xfs-r3 i686 AMD Athlon(tm) Processor 
GENTOO_MIRRORS="http://gentoo.linux.no/ 
http://www.ibiblio.org/pub/Linux/distributions/gentoo" 
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config 
/usr/kde/3/share/config 
/usr/X11R6/lib/X11/xkb:/usr/kde/3.1/share/config:/usr/share/config" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
PORTDIR="/usr/portage" 
DISTDIR="/usr/portage/distfiles" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR_OVERLAY="" 
USE="directfb aalib nas ggi 3dnow acl acpi alsa -apm arts avi berkdb -bonobo -cdr 
crypt cups dga dvd -encode -esd fbcon -gdbm gif -gnome gpm -gtk -gtkhtml -guile -imlib 
-java jikes jpeg kde -ldap -libg++ libwww maildir -mikmod mmx motif -mpeg mpi 
ncurses nls oav oggvorbis opengl -oss pam pda -pdflib -perl png -python qt quicktime 
readline samba -scanner sdl -slang spell ssl -svga tcpd -tetex truetype usb X x86 xml2 
-xmms xv zlib" 
COMPILER="gcc3" 
CHOST="i686-pc-linux-gnu" 
CFLAGS="-O2 -march=athlon -pipe -fomit-frame-pointer -funroll-loops -fforce-addr 
-finline-functions -falign-jumps=4 -falign-loops=4 -falign-functions=64 
-fprefetch-loop-arrays " 
CXXFLAGS="-O2 -march=athlon -pipe -fomit-frame-pointer -funroll-loops -fforce-addr 
-finline-functions -falign-jumps=4 -falign-loops=4 -falign-functions=64 
-fprefetch-loop-arrays " 
ACCEPT_KEYWORDS="x86" 
MAKEOPTS="-j2" 
AUTOCLEAN="yes" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
FEATURES="ccache sandbox userpriv usersandbox notitles"
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2003-06-05 09:10:56 UTC
which install did you do
1.2 ? 1.4 ?

Code listing 19.1: Configuring Hostname
 
# echo mymachine > /etc/hostname

 

Then edit /etc/dnsdomainname so that it contains your DNS domainname, i.e. mydomain.com. 

Code listing 19.2: Configuring Domainname
 
# echo mydomain.com > /etc/dnsdomainname

 

If you have a NIS domain, you should set it in /etc/nisdomainname. 

Code listing 19.3: Configuring NIS Domainname
 
# echo nis.mydomain.com > /etc/nisdomainname

 
Comment 2 Alexander Papaspyrou 2003-06-05 10:52:38 UTC
I did 1.4 and issued the stated things to my system. However, /etc/issue output is not 
correct: 
 
--8<-- snip --8<-- 
This is \n.\o, running \m-\s (kernel \r). 
Welcome to [\l] on \d, \t (\U logged in). 
-->8-- snap -->8-- 
 
expands to 
 
--8<-- snip --8<-- 
This is wallace.(none), running i686-Linux (kernel 2.4.20-xfs-r3). 
Welcome to [vc/1] on Thu Jun 5  2003, 17:45:08 (0 users logged in). 
-->8-- snap -->8-- 
 
Also, /bin/domainname returns (none). /bin/dnsdomainname seems to work correctly. 
Comment 3 Alexander Papaspyrou 2003-06-07 10:54:51 UTC
BTW, setting the domainname with 
 
	# domainname mydomain.net 
 
fixes this issue. Maybe this should be included into the hostname init script. 
Comment 4 Tom Collins 2003-06-24 03:01:12 UTC
For DHCP users (which I suspect is most home users), the domain name is
retrieved by the dchpcd client.  So I think the proper fix for those
folks is to add the -D flag to the /etc/init.d/net.eth0 script.  I did
this, and it does what I want.  This could easily be integrated into a
new baselayout.
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2003-06-30 14:16:10 UTC
> For DHCP users (which I suspect is most home users), the domain name is
> retrieved by the dchpcd client.  So I think the proper fix for those
> folks is to add the -D flag to the /etc/init.d/net.eth0 script.  I did
> this, and it does what I want.  This could easily be integrated into a
> new baselayout.
>

Personally I do not see this as an issue, as there is $dhcpcd_eth0, etc
that they can add the -D to if needed.
Comment 6 Tom Collins 2003-06-30 22:38:13 UTC
Good point.  I'll give it a try.  Seems like a better solution than 
adding it to the startup script.  Maybe a comment to this effect 
could be added to the system default /etc/conf.d/net file?
Comment 7 Mark Douglas 2003-07-04 01:25:53 UTC
While dhcp users can add -D if they want, this doesn't resolve the fact that the domainname is never set properly for static IP users.

I've done this and it has resolved all issues for me:

init.d # diff domainname domainname.old
52d51
<               /bin/domainname ${mydnsdomain}
Comment 8 Wolfram Schlich (RETIRED) gentoo-dev 2003-07-10 15:02:49 UTC
IMHO Gentoo should run the /etc/init.d/domainname script like /etc/init.d/hostname  - in /sbin/rc!

what's really strange is that you *have to* set /etc/nisdomainname to your dnsdomainname so that the output of 'domainname' (and the /etc/issue as well) shows the domainname you want...
Comment 9 Marius Mauch (RETIRED) gentoo-dev 2003-07-12 19:31:54 UTC
Created attachment 14424 [details, diff]
Patch for agetty

Patch for agetty (from util-linux-2.11z) to have an option in /etc/issue to
show the dns domainname (as this is annoying people). It does not interfere
with the NIS domainname.
Comment 10 Marius Mauch (RETIRED) gentoo-dev 2003-07-12 19:32:51 UTC
Created attachment 14425 [details, diff]
Patch for agetty manpage

Patch to document the new option in /etc/issue
Comment 11 Martin Schlemmer (RETIRED) gentoo-dev 2003-07-17 14:35:22 UTC
Hmm, nice Marius Mauch - did you send it to the upstream developers for
consideration ?

Anyhow, in -r6 of util-linux, with 1.8.6.9 that will support this.
Comment 12 Marius Mauch (RETIRED) gentoo-dev 2003-07-19 22:48:25 UTC
no, I didn't, just wrote it as a quick fix (motivated by drobbins). You think I should (it seems rather trivial for me) ?