You are not logged in.

#1 2007-07-21 18:35:38

CaspianXI
Member
Registered: 2007-05-29
Posts: 59

Setting my machine's hostname

Ok, I've got a feeling that this is an uber-n00b question, but I've followed advice on the Wiki, and on threads here... but it still doesn't work for me.

I've set HOSTNAME in /etc/rc.conf:

HOSTNAME="meme"

(ok, "meme" isn't my real hostname, but I'm using it here to avoid confusion)

And in /etc/hosts:

#<ip-address>    <hostname.domain.org>    <hostname>
127.0.0.1        localhost.localdomain    localhost
127.0.0.1        meme.localdomain    meme

I rebooted, and when I started XFCE, I got an error that XFCE can't find a internet address for myhost and suggested adding myhost to /etc/hosts.

I looked at /etc/logs/messages.log, and it started logging everything with "meme" instead of "myhost", so I know that I'm getting close. But $HOSTNAME is still "myhost".

Any help would be greatly appreciated.

Offline

#2 2007-07-21 18:47:44

steven
Member
Registered: 2007-07-17
Posts: 56

Re: Setting my machine's hostname

The second line in your /etc/hosts file is not required. Change it to the following:

#<ip-address>    <hostname.domain.org>    <hostname>
  127.0.0.1          localhost.localdomain          localhost meme

That, along with the setting in your /etc/rc.conf file, should set your hostname correctly, stop the error in XFCE and display your correct hostname when you type the command hostname in a terminal.

Last edited by steven (2007-07-21 18:49:41)

Offline

#3 2007-07-21 19:24:31

CaspianXI
Member
Registered: 2007-05-29
Posts: 59

Re: Setting my machine's hostname

Um... I just tried that... and still no go sad. I still get the XFCE error, and the command hostname spits back 'myhost'.

Is there something I'm missing here? I've got a feeling that it's something incredibly obvious wink...

Offline

#4 2007-07-21 19:31:04

steven
Member
Registered: 2007-07-17
Posts: 56

Re: Setting my machine's hostname

Ah sorry, my bad - the /etc/hosts file should read:

#<ip-address>    <hostname.domain.org>    <hostname>
  127.0.0.1          meme.localdomain          localhost meme

Notice meme.localdomain instead of localhost.localdomain.

Offline

#5 2007-07-21 19:49:23

CaspianXI
Member
Registered: 2007-05-29
Posts: 59

Re: Setting my machine's hostname

I'm sorry to say, but it's still not working for me. (I edited /etc/hosts and rebooted) I really don't know what in the world is up with my system... it's as if my hostname got frozen on myhost and it won't change...

Nevertheless, I appreciate your help, steven.

Offline

#6 2007-07-22 08:59:09

steven
Member
Registered: 2007-07-17
Posts: 56

Re: Setting my machine's hostname

Bizarre, I'm sure I haven't missed anything. I remember only needing to change the HOSTNAME in rc.conf and editing my /etc/hosts file, as shown above. I originally had the same error when starting XFCE, setting my hostname correctly in those two files did the job though.

When you type hostname in a terminal, what's the output?

Offline

#7 2007-07-22 20:36:32

CaspianXI
Member
Registered: 2007-05-29
Posts: 59

Re: Setting my machine's hostname

Aha!

For some reason, I booted my machine without the Ethernet cable plugged in... and the hostname changed. After a bit of digging around in my machine's and my router's settings, I finally figured that my network profile had a line 'HOSTNAME=myhost'. By simply deleting this line from all my network profiles and rebooting, I've fixed my hostname problem.

Thanks for helping out, steven... your comments helped me narrow this problem down big_smile.

Offline

#8 2007-07-23 00:22:19

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: Setting my machine's hostname

HOSTNAME="" should be a fully qualified domain name ie myhost.domain.org. Note the three entries seperated by a dot. Your hosts file should be similar:

127.0.0.1 myhost.domain.org localhost.localdomain localhost myhost

localhost.localdomain and friends are for program compatibility.

Offline

#9 2009-09-16 20:31:37

Carlwill
Member
From: Orlando, FL
Registered: 2008-10-06
Posts: 560
Website

Re: Setting my machine's hostname

...

Last edited by Carlwill (2009-09-16 20:32:14)


./

Offline

Board footer

Powered by FluxBB