Re: Problem with DHCP, /etc/hosts and GNOME

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Keven Ring wrote:
Rick Stevens wrote:

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.

Of course, if you tell the DHCP server what you want your hostname to be, *and* ask for the DHCP server to provide one back to you, *and* disregard the hostname that the DHCP server sends back, then you have an awfully friendly system... :)

Heheheh! Yup, that's the effect of it.

DHCP Client:  Please set my host name to xxx.yyy.zzz.
DHCP Server:  No chance.  Your host name is aaa.bbb.ccc
DHCP Client:  Screw you.  I'm setting my hostname to mmm.nnn.ooo

Fine. Is everyone happy now?

"I wanna be thishost.thisdomain.tld and regardless of what you say, that's what I'm gonna be! When I want your opinion, Mr. DHCP server, I'll beat it out of you! Neener, neener! Thhppt!" ---------------------------------------------------------------------- - Rick Stevens, Senior Systems Engineer rstevens@xxxxxxxxxxxxxxx - - VitalStream, Inc. http://www.vitalstream.com - - - - Millihelen, adj: The amount of beauty required to launch one ship. - ----------------------------------------------------------------------



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux