Gentoo Archives: gentoo-user

From: Kevin O'Gorman <kogorman@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Use of gethostname() and getdomainname()
Date: Sun, 02 Dec 2007 23:51:00
Message-Id: 9acccfe50712021545r546a1897h2fd7b4185820cdbd@mail.gmail.com
In Reply to: Re: [gentoo-user] Use of gethostname() and getdomainname() by Etaoin Shrdlu
1 I like keeping it to stuff that makes sense. I don't put in private network
2 addresses unless I actually use them,
3 which would just be the 192.168.x.x addresses provided by my DSL router,
4 behind which I hide most of my
5 systems. But for the present thread, I'm talking about the routable IP
6 number for this host: treat.kosmanor.com
7 is seen as 64.166.164.49.
8
9 I've got HOSTNAME=treat in /etc/conf.d/hostname, and the FQDN in
10 /etc/postfix/main.cf.
11
12 Meanwhile, I've stumbled on the Linux man page for uname(2). It explains
13 some of this as lack of coverage from the standards. Use "man 2 uname" and
14 look in the NOTES section. It seems this is an area that has not been well
15 treated, and there's divergence among systems as well as among applications,
16 let alone between them. Ugh.
17
18
19 On Dec 2, 2007 7:12 AM, Etaoin Shrdlu <shrdlu@×××××××××××××.org> wrote:
20
21 > On Sunday 2 December 2007, Mick wrote:
22 >
23 > > > Try adding the following line to /etc/hosts:
24 > > >
25 > > > a.b.c.d hostname.your.domain hostname
26 >
27 > > > of course, replacing a.b.c.d with your correct ip address.
28 > > >
29 > > > I don't know whether this is related to your problem, but it usually
30 > > > solves the domainname: (none) problem.
31 > >
32 > > Is this meant to be the LAN private address, or the Internet address
33 > > of the host?
34 >
35 > It depends. If you just need to solve the agetty banner problem which
36 > prints "welcome to machinename.(none)", you can just use 127.0.0.1 or
37 > eth0's address, and this always has solved all the problems for me until
38 > now. Otherwise, you have to know what address the application uses to
39 > identify the box. However, if in doubt, nothing stops you from adding
40 > several lines that differ only in the ip address:
41 >
42 > 127.0.0.1 hostname.your.domain hostname
43 > 10.0.0.1 hostname.your.domain hostname
44 > 100.100.100.100 hostname.your.domain hostname
45 >
46 > etc.
47 >
48 > NOTE: I don't know whether this is the correct way to do things. Many
49 > times it works, but other, less clumsy, ways probably exist (I simply
50 > haven't had the need to search them until now).
51 > --
52 > gentoo-user@g.o mailing list
53 >
54 >
55
56
57 --
58 Kevin O'Gorman, PhD