Red Hat Networking - Changing the hostname

This is Interesting: Free IT Magazines  
Home > Archive > Red Hat Networking > April 2004 > Changing the hostname





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Changing the hostname
No One

2004-04-11, 11:35 pm

I have a Linux machine on my local area network. I have run the
hostname command to change the host and domain name. I also ran the
domainname command. All is well till I reboot and it resets to
"localhost.localdomain". I am running RH 9. How do I keep the settings
on reboot? It has a static ip.

Bit Twister

2004-04-12, 12:35 am

On Mon, 12 Apr 2004 03:03:02 GMT, No One wrote:
> I have a Linux machine on my local area network. I have run the
> hostname command to change the host and domain name. I also ran the
> domainname command. All is well till I reboot and it resets to
> "localhost.localdomain". I am running RH 9. How do I keep the settings
> on reboot? It has a static ip.
>


Guessing,
cat /etc/sysconfig/network
HOSTNAME=wb.home.invalid <============
NETWORKING=yes
GATEWAY=192.168.1.1
Alexander Dalloz

2004-04-12, 11:44 am

On Mon, 12 Apr 2004 04:02:49 +0000 Bit Twister wrote:


> cat /etc/sysconfig/network
> HOSTNAME=wb.home.invalid <============
> NETWORKING=yes
> GATEWAY=192.168.1.1


And a corresponding entry line in /etc/hosts has to be set too.

Alexander


--
Alexander Dalloz | Enger, Germany
PGP key valid: made 13.07.1999
PGP fingerprint: 2307 88FD 2D41 038E 7416 14CD E197 6E88 ED69 5653

Bill Unruh

2004-04-12, 12:38 pm

No One <noone@yahoo.com> writes:

]I have a Linux machine on my local area network. I have run the
]hostname command to change the host and domain name. I also ran the
]domainname command. All is well till I reboot and it resets to
]"localhost.localdomain". I am running RH 9. How do I keep the settings
]on reboot? It has a static ip.

hostname only changes the running hostname. It does not save it.
/etc/sysconfig/network


No One

2004-04-12, 9:40 pm

Alexander Dalloz wrote:

> On Mon, 12 Apr 2004 04:02:49 +0000 Bit Twister wrote:
>
>
> And a corresponding entry line in /etc/hosts has to be set too.
>


I had already changed the files mentioned. Apparently the file to
change is /etc/sysconfig/network.

Tim

2004-04-13, 12:34 am

On Mon, 12 Apr 2004 04:02:49 GMT,
Bit Twister <BitTwister@localhost.localdomain> posted:

> HOSTNAME=wb.home.invalid


Some things will refuse to work with ".invalid" domains (like some mail
clients or servers). If you find some of your services behave that way,
you can try using the ".test" domain name, instead. (See: RFC2606.)

Just one of those little "gotchyas" that might come back to haunt you.

Excessive cross-posting has been trimmed a bit. I cannot post messages
when there's an unavailable group in the newsgroup header, and neither can
many other people.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
Rick Stuart

2004-04-20, 12:36 pm

Adding the HOSTNAME parameter to /etc/sysconfig/network is the first
step...If you are using DHCP, and would like to have your other machines
on the network find your linux box by name, you should also edit
/etc/sysconfig/network-scripts/ifcfg-eth0 (assuming your network device
is eth0).

Add the line: DHCP_HOSTNAME=hostname
Where: hostname is the name you want your system to be known as on
the network.

Works for Micro$oft DHCP and for my Dlink DCHP at home.

Bill Unruh wrote:
> No One <noone@yahoo.com> writes:
>
> ]I have a Linux machine on my local area network. I have run the
> ]hostname command to change the host and domain name. I also ran the
> ]domainname command. All is well till I reboot and it resets to
> ]"localhost.localdomain". I am running RH 9. How do I keep the settings
> ]on reboot? It has a static ip.
>
> hostname only changes the running hostname. It does not save it.
> /etc/sysconfig/network
>
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com