Red Hat Networking - Hostname change with DHCP

This is Interesting: Free IT Magazines  
Home > Archive > Red Hat Networking > January 2004 > Hostname change with DHCP





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 Hostname change with DHCP
Bob

2004-01-23, 7:47 pm

Hello,
I have seen a lot of examples of changing the default hostname but all
seem to assume a static IP. They also seem to say (most of them) that you
need to change /etc/hosts and /etc/sysconfig/network files. I think I'm ok
with replacing the HOSTNAME in the network file. And adding a line with
your new host name in /etc/hosts is fine but how do you know what ip to
use if you are using DHCP? My linksys router is 192.168.1.1 but of course
my system's ip varies (well sometimes). I know to leave the localhost line
alone in the /etc/hosts file too.
--
Regards,
Bob

Jacob Heider

2004-01-23, 7:47 pm

On Sun, 02 Nov 2003 03:47:38 +0000, Bob wrote:
quote:

> Hello,
> I have seen a lot of examples of changing the default hostname but all
> seem to assume a static IP. They also seem to say (most of them) that you
> need to change /etc/hosts and /etc/sysconfig/network files. I think I'm ok
> with replacing the HOSTNAME in the network file. And adding a line with
> your new host name in /etc/hosts is fine but how do you know what ip to
> use if you are using DHCP? My linksys router is 192.168.1.1 but of course
> my system's ip varies (well sometimes). I know to leave the localhost line
> alone in the /etc/hosts file too.



In /etc/hosts just change the first line that says:

127.0.0.1 localhost localhost.localdomain

to

127.0.0.1 localhost localhost.localdomain YOUR_HOSTNAME_HERE

BIG NOTE: Don't remove the localhost declarations. Simply add your
preferred host name at the end. If you change that line in other ways
your computer may fail to function properly! You are warned.

Jacob
Bob

2004-01-23, 7:47 pm

On Sun, 02 Nov 2003 05:24:43 +0000, Jacob Heider wrote:
quote:

> On Sun, 02 Nov 2003 03:47:38 +0000, Bob wrote:
>
>
> In /etc/hosts just change the first line that says:
>
> 127.0.0.1 localhost localhost.localdomain
>
> to
>
> 127.0.0.1 localhost localhost.localdomain YOUR_HOSTNAME_HERE
>
> BIG NOTE: Don't remove the localhost declarations. Simply add your
> preferred host name at the end. If you change that line in other ways
> your computer may fail to function properly! You are warned.
>
> Jacob


Thanks for the reply. If I may a couple of followup questions.
Can I say MY_HOSTNAME_HERE.MY_DOMAINNAME or can I only specify the
hostname?
Elsewhere I have seen someone suggest putting the following in the
/etc/sysconfig/network file:
DHCP_HOSTNAME=the_host_name_I_want
Is there any need for this or is it just another way to specify the host
name?
--
Regards,
Bob

Jacob Heider

2004-01-23, 7:47 pm

On Tue, 04 Nov 2003 06:35:39 +0000, Bob wrote:
quote:

> On Sun, 02 Nov 2003 05:24:43 +0000, Jacob Heider wrote:
>
> Thanks for the reply. If I may a couple of followup questions. Can I say
> MY_HOSTNAME_HERE.MY_DOMAINNAME or can I only specify the hostname?
> Elsewhere I have seen someone suggest putting the following in the
> /etc/sysconfig/network file:
> DHCP_HOSTNAME=the_host_name_I_want
> Is there any need for this or is it just another way to specify the host
> name?



I'd include the domainname and the hostname, separated by whitespace so
both can be resolved. Don't know about the environment variable
DHCP_HOSTNAME, but all you need is to be able to resolve the host name, so
just /etc/hosts should be fine.

Jacob
Bob

2004-01-23, 7:47 pm

On Sun, 02 Nov 2003 05:24:43 +0000, Jacob Heider wrote:
quote:

> On Sun, 02 Nov 2003 03:47:38 +0000, Bob wrote:
>
>
> In /etc/hosts just change the first line that says:
>
> 127.0.0.1 localhost localhost.localdomain
>
> to
>
> 127.0.0.1 localhost localhost.localdomain YOUR_HOSTNAME_HERE
>
> BIG NOTE: Don't remove the localhost declarations. Simply add your
> preferred host name at the end. If you change that line in other ways
> your computer may fail to function properly! You are warned.
>
> Jacob


Jacob,
I've tried what you (and others) have suggested but didn't get what I
hoped for. Now my problem may have been that I didn't state it well and
the suggestions have been good for a poorly defined issue.
So what I have is a Linksys rounter which has my internet provider
attached to it on the one side and three other computers attached to the
router on the system side.
When I check my router I find that there is no host name assoicated with
my machine's ip address. The other two system (both XP) have host names
assigned so the router would use the name if I could find a way to tell it
what to use.
Any suggestions? Cause I'm stumped!
--
Regards,
Bob

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com