Subject: rename a machine

From: [email-masked]
Date: Mon, 5 Aug 1996 11:35:39 -0400

Can anyone tell me how to _Permanently_ change the hostname on my 
     machine ???
     
     If I issue the hostname command: hostname newname
     
     the node name is set to newname - HOWEVER after a reboot the original 
     name returns.

     Where is this info written ?
     
     Thanx in advance...

---

From: [email-masked] (Tim 'The Unslept' Sailer)
Date: Mon, 5 Aug 1996 13:37:49 -0400 (EDT)

>      Where is this info written ?

edit /etc/hostname

Tim

-- 
		       [email-masked]
 "Great successes are built on taking your negatives and turning them around."
    -- Sumner Redstone
** Disclaimer: My views/comments/beliefs, as strange as they are, are my own.**

---

From: Will Waites <[email-masked]>
Date: Mon, 5 Aug 1996 14:01:33 -0400

>     Can anyone tell me how to _Permanently_ change the hostname on my 

edit /etc/hostname so that it contains the hostname that you want.
put hostname `cat /etc/hostname` in one of your rc.* scripts if it
isn't there already.

Will

---

From: Rob Browning <[email-masked]>
Date: 05 Aug 1996 12:57:06 -0500

>      Where is this info written ?

/etc/hostname at the minimum.

--
Rob

---

From: David C Winters <[email-masked]>
Date: Mon, 5 Aug 1996 13:55:30 -0400 (EDT)

>      Where is this info written ?

	Edit the single-line file /etc/hostname so it holds your 
machine's desired (new) hostname.

David [email-masked]

---

From: Warwick HARVEY <[email-masked]>
Date: Tue, 06 Aug 1996 04:18:21 +1000

>      the node name is set to newname - HOWEVER after a reboot the original 

The host name of a machine is stored in /etc/hostname.  This file is read by
/etc/init.d/boot at boot time.  Change it here and it's "permanent".

>      Where is this info written ?

I don't know that it is.  Whenever I'm wondering about this kind of thing
(and how I found the information I needed to answer your question), I
usually start by cd'ing to /etc and using fgrep on the contents of it and
its subdirectories...  This has the added benefit of throwing up instances
of what you want to change that you might not have thought about.  For
instance, on the Debian machine I tried this on, the host name also appears
in the following files:

/etc/hosts
/etc/mailname
/etc/smail/config

Your mileage may vary...

				Warwick

----------------------------------------------------------------------------
Warwick Harvey                                    email: [email-masked]
Department of Computer Science                        phone: +61-3-9287-9171
University of Melbourne                                 fax: +61-3-9348-1184
Parkville, Victoria, AUSTRALIA 3052     web: http://www.cs.mu.OZ.AU/~warwick

---

From: Randall Jones <[email-masked]>
Date: Mon, 5 Aug 1996 12:12:09 -0600 (MDT)

On Mon, 5 Aug 1996 [email-masked] wrote:

> ...

file: "/etc/hostname"
edit this file to change your hostname.

You might also want to add an entry in /etc/hosts for your new hostname.

Fun,

++Randy
[email-masked]
NRAO AOC - Interference Protection

---

From: Craig Sanders <[email-masked]>
Date: Tue, 6 Aug 1996 11:33:13 +1000 (EST)

On Tue, 6 Aug 1996, Warwick HARVEY wrote:

> >  the node name is set to newname - HOWEVER after a reboot the
> >  original name returns.
>
> The host name of a machine is stored in /etc/hostname. This file
> is read by /etc/init.d/boot at boot time. Change it here and it's
> "permanent".

lots of other config files may have the old hostname as well.  When i change
the hostname on a machine i usually edit /etc/hostname as mentioned above,
and then grep in /etc for any other files containing the hostname.

e.g. if the old hostname is "oldhost", then:

    find /etc | xargs grep -l oldhost

will give a list of files containing the word oldhost.  edit them with your
favourite text editor (vi!) to change them.

some files will just want the hostname.  some will want
hostname.domain.name.  check the relevant man pages to be sure if it isn't
obvious from the file you are editing.

> /etc/smail/config

yep, also look in /etc/mail/sendmail.mc, /etc/mail/sendmail.cw if you are
running sendmail.  the "find ... | grep ..." command above should find them
all.

Craig