Changing Hostname

Changing Hostname

Post by The Illie » Tue, 03 Sep 2002 01:02:42



I'm trying to change the hostname on my computer.  I've run (as root)
hostname and got localhost.localdomain.  However, I would like it to be
"Frank" (don't ask).  To change this, I went to RH's site and found a
small bit of instruction that says type hostname *hostname* to change
it.  I've done this and then retyped hostname to get the current one.
Frank showed up.  However, when I reboot the computer, it says that it
is setting the hostname to localhost.localdomain.  Apparently the
hostname command isn't making any permanent changes.  How do I
permanently change my hostname.

The Illien

 
 
 

Changing Hostname

Post by Eric Worral » Tue, 03 Sep 2002 01:10:51



> I'm trying to change the hostname on my computer.  I've run (as root)
> hostname and got localhost.localdomain.  However, I would like it to be
> "Frank" (don't ask).  To change this, I went to RH's site and found a
> small bit of instruction that says type hostname *hostname* to change
> it.  I've done this and then retyped hostname to get the current one.
> Frank showed up.  However, when I reboot the computer, it says that it
> is setting the hostname to localhost.localdomain.  Apparently the
> hostname command isn't making any permanent changes.  How do I
> permanently change my hostname.

> The Illien

AFAIK Hostname is set in the file /etc/sysconfig/network on Red Hat
machines (I use Mandrake, a derivative of RH, the file is
/etc/sysconfig/network). You need to be root to edit
/etc/sysconfig/network.

If your machine does not have an /etc/sysconfig/network file, you could
look for references to HOSTNAME using fgrep.

fgrep -r "HOSTNAME" /etc

You might also want to add a new entry to /etc/hosts
127.0.0.1       Frank

Eric Worrall

--
You have just received an Etech Solution
For all your Linux requirements contact


 
 
 

Changing Hostname

Post by Johan Lindquis » Tue, 03 Sep 2002 05:49:17


On Sun, 01 Sep 2002 at 18:10 GMT, gazing longingly at the horizon,

felt a deep, passionate desire to let the following be known:

Quote:> You might also want to add a new entry to /etc/hosts
> 127.0.0.1  Frank

A better idea would be to give the computer a "fake" ip, for example
192.168.0.1 and adding that to /etc/hosts instead. Changing or
removing the localhost entry in /etc/hosts can potentially*up
printing, for example.

--
Time flies like an arrow, fruit flies like a banana.      Perth ---> *
 10:39pm  up 2 days, 11:44,  3 users,  load average: 1.41, 1.34, 1.35
$ cat /dev/bollocks                      Registered Linux user #261729
exploit next-generation markets

 
 
 

Changing Hostname

Post by Steve Ackma » Fri, 06 Sep 2002 08:21:59



> On Sun, 01 Sep 2002 at 18:10 GMT, gazing longingly at the horizon,

> felt a deep, passionate desire to let the following be known:

>> You might also want to add a new entry to /etc/hosts
>> 127.0.0.1      Frank

> A better idea would be to give the computer a "fake" ip, for example
> 192.168.0.1 and adding that to /etc/hosts instead. Changing or
> removing the localhost entry in /etc/hosts can potentially*up
> printing, for example.

  Yes, *add* to /etc/hosts, don't replace it.

127.0.0.1       localhost       Frank

  In this case, say you run a web server.

http://www.veryComputer.com/
http://localhost/
http://Frank/

will all get you the same page.

--
Steve Ackman
http://www.veryComputer.com/ (Need green beans?)
http://www.veryComputer.com/               (glass, linux & other stuff)

 
 
 

1. Changing Hostname Broke SMC

I recently did a sys-unconfig on my Solaris 10 box for several reasons.
 One reason was to change the hostname.  Since doing so, the Solaris
Management Console can't load the toolbox - it keeps looking for it
under the old hostname.  And if I do manually open the toolbox from
/var/sadm/smc/toolboxes/this_computer, the tools don't work.  What can
I do to fix this?

I read somewhere that I need to use SMC Edit, but I still can't figure
out the details.  Anybody know how to do this?

Thanks,
Dan

2. performance tuning

3. CDE cannot login after changing hostname...

4. WinNuke for Windows 95 & NT

5. changing hostname value

6. mc

7. Wrong posting: Changing Hostname made my Linux Box go crazy, Correction here

8. CERN httpd -password protection setup

9. How to change hostname under Solaris8 static?

10. change hostname

11. How to change hostname etc ..

12. changing hostname/it's impact on xemacs and sendmail.

13. Changing hostname???