Problem with DHCP, /etc/hosts and GNOME

Rick Stevens rstevens at vitalstream.com
Thu Apr 8 20:28:55 UTC 2004


Keven Ring wrote:
> William Hooper wrote:
> 
>> Satish Balay said:
>>
>>  
>>
>>> Ah.. I interptered it as - an option to dhcp-clinet (not server) to
>>> ignore what dhcp server says - and use the provided value as the
>>> hostname. Perhpas there should be some other option for this
>>> functionality? (RFE)
>>>
>>> I don't like hostname changing (when you move laptop between networks)
>>> - this changes xauth which messes up everything else..
>>>   
>>
>>
>> A quick browse through the networking scripts suggests that the hostname
>> will only change if it is "localhost".  I haven't looked too hard 
>> though. I know that I don't have a problem with my laptop, which I set 
>> the
>> hostname on during install (but that was with RHL 9 and an upgrade to
>> FC1).  It may be more of a case of the DHCP servers I'm using not trying
>> to change the hostname, though.
>>
>>
>>  
>>
> It's in the /etc/sysconfig/network-scripts/network-functions script.  
> There is a function called need_hostname().
> 
> Returns 0 if the current hostname is "localhost", 
> "localhost.localdomain" or "(none)".  Returns 1 otherwise.  This 
> function is called in the /etc/sysconfig/network-scripts/ifup script.  
> However, again, just like everything else, just because the DHCP client 
> *requests* a hostname, does not mean that the DHCP server is obliged to 
> hand one back...

And you're not "obligated" to accept it.  You can set

	supersede host-name "your-host-name"

in your /etc/dhclient/dhclient.conf file to override whatever the DHCP
server gives you.  see "dhclient.conf(5)" and "dhcp-options(5)" for
info.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-    If your broker is so damned smart...why is he still working?    -
----------------------------------------------------------------------





More information about the fedora-list mailing list