Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to change Hostname.

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
User avatar
Zriza
Posts: 82
Joined: 2006-08-25 18:23
Location: Copenhagen - Denmark

How to change Hostname.

#1 Post by Zriza »

How do i change my hostname from "joe" to "carl" (debian@JOE:~$) ? I've tried the idea with changing it in /etc/hostname, but that just caused trouble with installations and programs.

Lavene
Site admin
Site admin
Posts: 4958
Joined: 2006-01-04 04:26
Location: Oslo, Norway

#2 Post by Lavene »

Personally I have never needed to permanently change a hostname, but one way to do it is described here: http://www.debianhelp.co.uk/hostname.htm

Tina :)

pelle
Posts: 25
Joined: 2006-08-29 07:12
Location: Sweden

#3 Post by pelle »

In essence:

echo NEWHOSTNAME >/etc/hostname
/etc/init.d/hostname.sh

You might also need to change it in /etc/hosts (especially if you run into problems with programs as you say).

SillyMary
Posts: 38
Joined: 2006-08-16 16:44
Location: Groningen, The Netherlands

#4 Post by SillyMary »

As far as I know you only have to change the name in /etc/hostname. The new name will be visible when you reboot.

pelle
Posts: 25
Joined: 2006-08-29 07:12
Location: Sweden

#5 Post by pelle »

SillyMary wrote:As far as I know you only have to change the name in /etc/hostname. The new name will be visible when you reboot.
That's true, but if you run /etc/init.d/hostname.sh you don't have to reboot.

debian-installer sometimes put the hostname in /etc/hosts too, so you might need to change it there for programs which expect it. (Some programs need to be able to lookup the hostname so it must either be in DNS or in /etc/hosts.)

User avatar
Zriza
Posts: 82
Joined: 2006-08-25 18:23
Location: Copenhagen - Denmark

#6 Post by Zriza »

Thx for the answers.

Post Reply