Re: setting network hostname for Auto eth0



From: Dan Williams <dcbw redhat com>
Subject: Re: setting network hostname for Auto eth0
Date: Fri, 30 Jan 2009 11:35:58 -0500

> On Fri, 2009-01-30 at 09:06 -0500, Peter F. Patel-Schneider wrote:
> > Hi:
> > 
> > I'm having a minor problem getting network manager (0.7.0 under Fedora
> > 10) to set my network hostname when it automatically connects to a
> > network.
> 
> Are you using different hostnames for different connections, or a
> machine-wide hostname?  If you want to set a machine hostname, add
> "HOSTNAME=mycomputer" to /etc/sysconfig/network, and NetworkManager will
> ensure that hostname is always applied to you computer.
> 
> > Using system-config-network, I can set
> > 	DHCP Settings:
> > 	Hostname (optional): x.y.z
> > for eth0 and then when I connect to System eth0 my network hostname is
> > correctly set.
> 
> The hostname shown here is what gets sent to the DHCP server when you
> are using Microsoft DHCP, which then (on the server) updates the DNS
> entry for your machine with your IP address.  It doesn't not necessarily
> get applied to your machine when you connect, either with NetworkManager
> or with normal ifup/ifdown/system-config-network.
> 
> > However, I don't see anything analogous for Auto eth0 (except, maybe,
> > DHCP client ID) but this doesn't seem to do the trick).
> > 
> > Anyway, I wouldn't bother with all this if I could automatically connect
> > to System eth0, but it doesn't seem possible to change this setting for
> > System eth0 (as I can't change anything for System eth0).
> 
> At the moment, you can change this connection in system-config-network.
> Setting the "DHCP Hostname" for this connection in system-config-network
> should make NetworkManager send that hostname to the DHCP server.
> 
> Dan


Sorry for not being completely clear.

For background, I'm checking all this on a Fedora 10 machine with
NetworkManager 0.7.0 and after some fiddling around with NetworkManager
settings.

I want to be able to set the DNS name of my laptop, so that I can
connect to my laptop by name no matter what IP address it currently has
on my work network.  The DNS servers at work do do this, as long as they
are asked.

I believe that the /etc/sysconfig/network HOSTNAME field is used to set
the local machine name (network node name or `uname -n`) on startup.
This is not what I want to do.  It appears that Network Manager never
uses this information to set up a DNS name.

For the "System eth0" connection, NetworkManager appears to use the
ifcfg-eth0 script and if there is a DHCP_HOSTNAME entry there will
request that name for the DNS name.   This is what I want to do.
However, I can't figure out how to have Network Manager automatically
connnect to "System eth0" on login.

The "Auto eth0" connection does not appear to use any DHCP_HOSTNAME
information, so I can't use it.


Is there a way to have a "Connect automatically" connection for eth0
that also sets up the DNS name?


Peter F. Patel-Schneider


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