PCs named localhost.localdomain

Questions and Answers : Unix/Linux : PCs named localhost.localdomain
Message board moderation

To post messages, you must log in.

AuthorMessage
Jason Dravet

Send message
Joined: 6 Jul 99
Posts: 2
Credit: 14,406
RAC: 0
United States
Message 1572 - Posted: 25 Jun 2004, 1:06:21 UTC

Several of my registered PCs have the name of localhost.localdomain. I think the boinc client just looks for the first string after 127.0.0.1 in the /etc/hosts file. Either an option to rename the PCs needs to be added or the client needs to skip localhost, localhost.localdomain, and 127.0.0.1 when reading the /etc/hosts file.

Just my $0.02.
ID: 1572 · Report as offensive
Darren
Volunteer tester
Avatar

Send message
Joined: 2 Jul 99
Posts: 259
Credit: 280,503
RAC: 0
United States
Message 1581 - Posted: 25 Jun 2004, 1:18:10 UTC
Last modified: 25 Jun 2004, 1:19:31 UTC

Not sure where it comes from, but it's not taking the first line of /etc/hosts. None of my hosts are identified as localhost, but that's the first entry in /etc/hosts.

As an example, my primary system has /etc/hosts of:

127.0.0.1 localhost
192.168.1.19 platinum

But boinc identifies the systym as "platinum" and IP as "192.168.1.19".

The data for the identity is transmitted to the seti server by ping, so however your system is identifying itself in a ping is how it will show on the seti servers.

As a side note, this is only visible to you. The host name and ip does not show on a regular view of someone's hosts. It only shows for an account that you are logged in to.



ID: 1581 · Report as offensive
Profile AthlonRob
Volunteer developer
Avatar

Send message
Joined: 18 May 99
Posts: 378
Credit: 7,041
RAC: 0
United States
Message 1729 - Posted: 25 Jun 2004, 6:43:11 UTC

The way the IP is *currently* obtained is essentially with gethostname() and gethostbyname().

It looks like this is going to change by M2, though... since you can't statically link gethostbyname() with freakin' glibc issues. :-)

You really should set up some proper hostnames for your systems. localhost.localdomain will cause problems with many software programs available for linux.

Rob
ID: 1729 · Report as offensive
Jason Dravet

Send message
Joined: 6 Jul 99
Posts: 2
Credit: 14,406
RAC: 0
United States
Message 1977 - Posted: 25 Jun 2004, 16:41:40 UTC - in response to Message 1581.  

my /etc/hosts has the following line:

127.0.0.1 localhost.localdomain cc1 localhost

that is it. I am pretty sure I have proper hostnames. I can ping the PC using ping cc1 and the ip 192.168.8.212 is returned and the ping is successful. So how can I make sure I have proper hostnames? The client uses dhcp to get it IP address, and domain name (networktest.local).

Thanks,

Jason

> Not sure where it comes from, but it's not taking the first line of
> /etc/hosts. None of my hosts are identified as localhost, but that's the
> first entry in /etc/hosts.
>
> As an example, my primary system has /etc/hosts of:
>
> 127.0.0.1 localhost
> 192.168.1.19 platinum
>
> But boinc identifies the systym as "platinum" and IP as "192.168.1.19".
>
> The data for the identity is transmitted to the seti server by ping, so
> however your system is identifying itself in a ping is how it will show on the
> seti servers.
>
> As a side note, this is only visible to you. The host name and ip does not
> show on a regular view of someone's hosts. It only shows for an account that
> you are logged in to.
>
>
> <a> href="http://www.boinc.dk/index.php?page=user_statistics&userid=24497">
>
>
ID: 1977 · Report as offensive
fifieldt

Send message
Joined: 6 Jun 02
Posts: 2
Credit: 203,091
RAC: 0
Australia
Message 2534 - Posted: 29 Jun 2004, 8:18:38 UTC - in response to Message 1581.  

It certainly is a weird problem.

I have 2 linux hosts.

One was Identified correctly as gummoBox - 192.168.1.9, the other was shown as localhost.

gummoBox
127.0.0.1 localhost
192.168.1.9 gummoBox


Frogstar_A
127.0.0.1 localhost
192.168.1.13 Frogstar_A

What is the link for reoccurance, or is it completely random ?
ID: 2534 · Report as offensive
fifieldt

Send message
Joined: 6 Jun 02
Posts: 2
Credit: 203,091
RAC: 0
Australia
Message 2940 - Posted: 1 Jul 2004, 2:39:07 UTC - in response to Message 2534.  

It seems it just worked out, localhost has magically become Frogstar_A.

Rejoice!
ID: 2940 · Report as offensive
Profile Chuck R. Bell
Avatar

Send message
Joined: 27 Feb 00
Posts: 13
Credit: 11,042,103
RAC: 0
United States
Message 86734 - Posted: 16 Mar 2005, 23:02:38 UTC

IMHO this is a bug.

127.0.0.1 should NEVER be named with the name of the machine.

Also, whatever is causing this is not consistent. Out of 20 computers with the /etc/hosts file set correctly, only two appear as 'localhost' in my SETI/BOINC account 'Your Computers' list.

By trial and error, on those two computers, I have discovered that a work-around is to not list the 127.0.0.1 entry first. So instead of:

-----clip-----
# For loopbacking.
127.0.0.1 localhost
192.168.0.8 neoslak neoslak.dynetx.org
-----clip-----

use:

-----clip-----
192.168.0.8 neoslak neoslak.dynetx.org

# For loopbacking.
127.0.0.1 localhost
-----clip-----


Hope this helps.


Chuck Bell


 We Listen and Compute!
            |/
         ( q p )
------oOOo-(_)-oOOo-------
http://www.dianetics.org
ID: 86734 · Report as offensive
Profile Trane Francks

Send message
Joined: 18 Jun 99
Posts: 221
Credit: 122,319
RAC: 0
Japan
Message 86822 - Posted: 17 Mar 2005, 3:08:52 UTC

> I am pretty sure I have proper hostnames.

Definitely not. Your PC name must not be the same as the name used for the loopback device. Give your machines proper names and you're set.

ID: 86822 · Report as offensive
Knahrvorn

Send message
Joined: 29 Nov 05
Posts: 2
Credit: 16,263
RAC: 0
Denmark
Message 238723 - Posted: 28 Jan 2006, 11:25:29 UTC - in response to Message 1581.  

Out of curiosity: How do you set up a proper hostname if your (internal) IP address isn't static? I have a laptop with a wireless network card, and sometimes I'm 192.168.0.2, sometimes 10.0.0.5, pepending on where I connect.
ID: 238723 · Report as offensive
Knahrvorn

Send message
Joined: 29 Nov 05
Posts: 2
Credit: 16,263
RAC: 0
Denmark
Message 238726 - Posted: 28 Jan 2006, 11:33:41 UTC - in response to Message 86734.  

127.0.0.1 should NEVER be named with the name of the machine.


You have to take that up with several distro guys, I guess. I've only looked for this in Fedora and Ubuntu, and they both seem to assign the name of the machine to 127.0.0.1 -- Fedora as the first name on the line, Ubuntu as the last one.

BTW, what is the problem about doing this? It certainly solves problems about having non-static LAN IP, and I can't recall that it has ever made any trouble for me.
ID: 238726 · Report as offensive
Profile RottenMutt
Avatar

Send message
Joined: 15 Mar 01
Posts: 1011
Credit: 230,314,058
RAC: 0
United States
Message 462809 - Posted: 21 Nov 2006, 4:29:05 UTC

Ok, i confused. how should hosts be setup? can i have examples for static and dynamic. it seems some know, but just say it is wrong....
ID: 462809 · Report as offensive
Dotsch
Volunteer tester
Avatar

Send message
Joined: 9 Jun 99
Posts: 2422
Credit: 919,393
RAC: 0
Germany
Message 462963 - Posted: 21 Nov 2006, 16:39:58 UTC - in response to Message 462809.  

Ok, i confused. how should hosts be setup? can i have examples for static and dynamic. it seems some know, but just say it is wrong....

Please look at the example from Chuck R. Bell or in the thread http://setiathome.berkeley.edu/forum_thread.php?id=35495, it is exatcly the right example you need
ID: 462963 · Report as offensive

Questions and Answers : Unix/Linux : PCs named localhost.localdomain


 
©2025 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.