Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
localhost.(none) - How do I fix this?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
glawrie
Tux's lil' helper
Tux's lil' helper


Joined: 12 Oct 2003
Posts: 88
Location: Maidenhead, UK

PostPosted: Sat Oct 08, 2005 12:31 am    Post subject: localhost.(none) - How do I fix this? Reply with quote

Hi,

I am sure this is easy to answer, but I've been unable to get to bottom of it. I have recently built a (in fact this) Gentoo 2005.1 system on a Compaq evo N800c laptop. Thanks to some great help from others it now runs really well. But I cannot get it to recognise a network ID. Whatever I do I end up with it reporting itself as localhost.(none).

I am sure this is simple operator error on my part - but I cannot find a document explaining how to set up a network id - I am sure it is out there somewhere... Could someone help by pointing me in right direction?

Many thanks!

Gavin Lawrie
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sat Oct 08, 2005 12:48 am    Post subject: Reply with quote

Code:
/etc/conf.d/hostname:
HOSTNAME="myhost"

/etc/conf.d/domainname:
NISDOMAIN="mydomain.priv"

/etc/hosts:
127.0.0.1 myhost.mydomain.priv myhost localhost


Dunno if this is 100% right though.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Oct 08, 2005 2:47 am    Post subject: Reply with quote

The standard is for /etc/hosts to start with:
Code:
127.0.0.1       localhost blah...

Some apps (e.g. festival) will break with their default config, if 127.0.0.1 does not resolve to exactly "localhost".

The problem with the startup domain name of "(none)" is I think down to the "domainname" command - try "man domainname". It's a weird mix between DNS & NIS :)
Back to top
View user's profile Send private message
robbyjo
Guru
Guru


Joined: 06 Apr 2003
Posts: 462

PostPosted: Sat Oct 08, 2005 5:07 am    Post subject: Reply with quote

To add frostschutz, I'd add:

Code:
rc-update add domainname default


and make sure you don't have /etc/domainname and /etc/hostname (rename them to something else)
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sat Oct 08, 2005 1:17 pm    Post subject: Reply with quote

PaulBredbury wrote:
The standard is for /etc/hosts to start with:
Code:
127.0.0.1       localhost blah...

Some apps (e.g. festival) will break with their default config, if 127.0.0.1 does not resolve to exactly "localhost".


I'm not using festival, but so far I have not been experiencing any problems with my settings. Why does festival have a problem with localhost aliases?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Oct 08, 2005 9:22 pm    Post subject: Reply with quote

frostschutz wrote:
Why does festival have a problem with localhost aliases?

/etc/festival/server.scm contains a line:
Code:
(set! server_access_list '("[^.]+" "localhost.*"))

So, by default, Festival would reject requests when running on a PC with a non-standard /etc/hosts config.

This is easily fixable by modifying that line, but it demonstrates that an app can make an assumption about localhost. I expect there are other apps with this issue, but can't think of any (mainly because I'm not exposed to the problem).
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2977
Location: Germany

PostPosted: Sat Oct 08, 2005 10:10 pm    Post subject: Reply with quote

Hmmm, I did a bit of research, and now I've read multiple times that the localhost line should be left alone like this:
Code:
127.0.0.1        localhost
and you're not supposed to add anything to it.

So, still curious, what's the correct way to get Gentoo Linux to greet you with 'This is yourhost.yourdomain.bla', then?

EDIT:
According to an Usenet article, probably like this:

Code:
/etc/hosts:
...
127.0.0.1        localhost
127.0.0.2        yourhost.yourdomain yourhost
...
Back to top
View user's profile Send private message
dgaffuri
Advocate
Advocate


Joined: 05 Jun 2005
Posts: 2078
Location: Italy

PostPosted: Sat Oct 08, 2005 11:03 pm    Post subject: Reply with quote

Well, this is what I've understood until now. A correct /etc/hosts if you use a static IP (like 192.168.0.2) should be
Code:
127.0.0.1       localhost
192.168.0.2     host host.domain

while with DHCP (and a dynamic DNS) the second line should not be there, your FQDN should be registered in a reverse zone by the DNS and resolved using the DNS itself.
man hostname wrote:
Technically: The FQDN is the name gethostbyname(2) returns for the host name returned by gethostname(2). The DNS domain name is the part after the first dot.

The FQDN and the DNS domain name as returned by
Code:
hostname -f
dnsomainname

are resolved in the order defined in
Code:
/etc/nsswitch.conf

that defaults to fiirst /etc/hosts and then DNS
Code:
hosts:       files dns

So the problem arise when you use DHCP without a dynamic DNS (such as the DHCP server on my ADSL router), because you're no more able to resolve your FQDN unless you put it in /etc/hosts, under the real address (wich may change) or a 127.0.0.x one.
But in the second case you're causing software that use gethostbyname(2) to retrieve the IP address (and maybe listen on it) to find the local address instead of the network one.

So, if someone out there can correct me or have some suggestion to solve this problem, he will be welcome.
_________________
Adopt an unanswered post
If you feel that your problem has been solved please edit the top post and add [solved] to the subject
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum