Gentoo Archives: gentoo-user

From: reader@×××××××.com
To: gentoo-user@l.g.o
Subject: [gentoo-user] getting the right answer from `hostname --long'
Date: Sun, 29 Jan 2006 06:46:09
Message-Id: 87slr77czq.fsf@newsguy.com
1 Just trashed the mobo on my gentoo machine and reinstalled on a
2 different machine entirely.
3
4 (sendmail-8.13.4)
5 I'm setting up sendmail... something I've done many times but each
6 time it has been a right pain in the butt. No exception this time...
7 I'm not running a mailserver, just a stand alone machine that
8 retrieves and sends my personal mail.
9
10 I've used sendmail successfully for 8-9 yrs and have no interest in
11 changing MTA's unless there is a very good reason.
12
13 In previous installs I haven't had this particular problem. Sendmail
14 and other apps complain of not finding a qualified host name.
15
16 I've always used a home-made host name (for 8-9 yrs now)...
17 in this case:
18 chub.local.net0
19
20 I've setup these files:
21
22 hosts - resolv.conf - /etc/conf.d/hostname - /etc/conf.d/domainname
23
24 I'm not running bind or anything involving /etc/nsswitch
25
26 Putting the right stuff in these has always done the trick but not
27 this time. I may be forgetting something:
28
29 hosts:
30
31 127.0.0.1 localhost chub
32 ## ============================
33 192.168.x.xx chub.local.net0 chub # gentoo
34 [...]
35
36 Resolv.conf:
37 nameserver 192.168.0.20 # Its a gateway router that queries
38 # IPS nameservers
39 domain local.net0
40
41 /etc/conf.d/hostname:
42 # Set to the hostname of this machine
43 HOSTNAME="chub"
44
45 /etc/conf.d/domainname:
46
47 # /etc/conf.d/domainname
48
49 # When setting up resolv.conf, what should take precedence?
50 # If you wish to always override DHCP/whatever, set this to 1.
51 OVERRIDE=1
52
53 # To have a proper FQDN, you need to setup /etc/hosts and /etc/resolv.conf
54 # properly (domain entry in /etc/resolv.conf, and FQDN in /etc/hosts).
55 #
56 DNSDOMAIN="local.net0"
57
58 # This only set what /bin/hostname returns. If you need to setup NIS, meaning
59 # what /bin/domainname returns, please see:
60 #
61 # http://www.linux-nis.org/nis-howto/HOWTO/
62 #
63 # NISDOMAIN=
64
65
66 With all this set the `hostname' command returns:
67 hostname chub
68 hostname --long localhost
69
70 I want to see `local.net0' not `localhost'... so does sendmail and
71 squid I think.
72
73 Can anyone spot what I've forgotten or messed up?
74
75 --
76 gentoo-user@g.o mailing list