You are not logged in.

#1 2006-12-03 11:14:10

Shagbag
Member
Registered: 2006-10-25
Posts: 259

How do I change my hostname? [RESOLVED]

I see that HOSTNAME="myhost" is in my /etc/rc.conf file.
If I want to change it, do I simply edit the /etc/rc.conf file or do I need to edit other files as well?  Or can I just run the hostname command?

Offline

#2 2006-12-03 11:19:11

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

Re: How do I change my hostname? [RESOLVED]

Yes, just edit rc.conf and add your new hostname to /etc/hosts on the same line as localhost.

Offline

#3 2006-12-03 11:21:39

Zoranthus
Member
From: muc
Registered: 2006-11-22
Posts: 166

Re: How do I change my hostname? [RESOLVED]

If you also want to change the "name" of what gets resoluted to "127.0.0.1", change

127.0.0.1               localhost.localdomain   localhost

to something like

127.0.0.1               r0flcopter.localdomain   r0flcopter

in /etc/hosts too.

some daemons might listen explicitly on localhost:portxy though, so you have to make yout changes there too (r0flcopter:portxy).. was like that for cups once at least.

Offline

#4 2006-12-03 12:42:35

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: How do I change my hostname? [RESOLVED]

You can just add two lines though:
/etc/hosts

127.0.0.1 localhost.localdomain localhost
127.0.0.1 r0flcopter.localdomain r0flcopter

(cf blocking ads using your /etc/hosts file)


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#5 2006-12-03 12:56:52

T-Dawg
Forum Fellow
From: Wilmington, NC
Registered: 2005-01-29
Posts: 2,734

Re: How do I change my hostname? [RESOLVED]

you can string them alltogether on one line. I would make sure 'localhost' is included whatever you do -many program look for that.

Offline

#6 2006-12-03 16:09:31

Shagbag
Member
Registered: 2006-10-25
Posts: 259

Re: How do I change my hostname? [RESOLVED]

Thanks everyone.  I've changed it. smile

Offline

Board footer

Powered by FluxBB