Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Changing a hostname?
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
christopher_farley
n00b
n00b


Joined: 21 Dec 2002
Posts: 30

PostPosted: Mon Sep 20, 2004 6:01 pm    Post subject: Changing a hostname? Reply with quote

I want to change the hostname of a machine. It seems like I should simply alter the hostname in /etc/hostname and do an env-update. However, all of the profile.env and csh.env all retain the old hostname.

Where is the hostname located, and how should I change it?
Back to top
View user's profile Send private message
Ssl
Apprentice
Apprentice


Joined: 21 Feb 2003
Posts: 178
Location: Serbia

PostPosted: Mon Sep 20, 2004 6:45 pm    Post subject: Reply with quote

Go for it ;)
Change /etc/hostname in an editor or
echo newname > /etc/hostname

Tried source /etc/profile ?
Ssl
Back to top
View user's profile Send private message
christopher_farley
n00b
n00b


Joined: 21 Dec 2002
Posts: 30

PostPosted: Mon Sep 20, 2004 7:01 pm    Post subject: Reply with quote

That's the thing.

I changed /etc/hostname

I ran env-update

The profile.env file still retains the *old* hostname.

Where else is the hostname?
Back to top
View user's profile Send private message
christopher_farley
n00b
n00b


Joined: 21 Dec 2002
Posts: 30

PostPosted: Mon Sep 20, 2004 7:07 pm    Post subject: Reply with quote

Resolved.

I had to change the hostname in /etc/env.d/01hostname

Is that now the normal place to change the hostname? Hmm...
Back to top
View user's profile Send private message
tbfr
n00b
n00b


Joined: 03 Jan 2004
Posts: 26

PostPosted: Mon Sep 20, 2004 7:44 pm    Post subject: Reply with quote

in general you just have to edit /etc/hostname and run hostname --file /etc/hostname to activate the new hostname.

/etc/init.d/hostname restart writes the new hostname into /etc/env.d/01hostname too, seems to be the gentoo way.

rebooting the computer will work too of course. also take a look at /etc/hosts.
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