View previous topic :: View next topic |
Author |
Message |
christopher_farley n00b
Joined: 21 Dec 2002 Posts: 30
|
Posted: Mon Sep 20, 2004 6:01 pm Post subject: Changing a hostname? |
|
|
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 |
|
|
Ssl Apprentice
Joined: 21 Feb 2003 Posts: 178 Location: Serbia
|
Posted: Mon Sep 20, 2004 6:45 pm Post subject: |
|
|
Go for it
Change /etc/hostname in an editor or
echo newname > /etc/hostname
Tried source /etc/profile ?
Ssl |
|
Back to top |
|
|
christopher_farley n00b
Joined: 21 Dec 2002 Posts: 30
|
Posted: Mon Sep 20, 2004 7:01 pm Post subject: |
|
|
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 |
|
|
christopher_farley n00b
Joined: 21 Dec 2002 Posts: 30
|
Posted: Mon Sep 20, 2004 7:07 pm Post subject: |
|
|
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 |
|
|
tbfr n00b
Joined: 03 Jan 2004 Posts: 26
|
Posted: Mon Sep 20, 2004 7:44 pm Post subject: |
|
|
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 |
|
|
|