[CentOS] DHCP_HOSTNAME in ifcfg-eth0

Tue Nov 29 15:52:06 UTC 2011
Timothy Madden <terminatorul at gmail.com>

On 29.11.2011 15:57, Timothy Madden wrote:
> Hello
>
> Is there a way for the dhcp client to send the current host name of the
> machine when requesting a lease ?
>
> Currently I have to include a line like
> 	DHCP_HOSTNAME=appserver2
> in my /etc/sysconfig/network-scripts/ifcfg-eth0, but I would like to
> tell the dhcp client to just 'also send the hostname' and then the
> client to get the current hostname itself, instead of having the name
> hard-coded in the ifcfg-eth0 file.
>
> I am trying to get my router to know the names of all my CentOS
> machines, as currently I can access none of my CentOS machines by their
> node name (I get 'unknown host' upon name lookup) and maybe it will help
> if the router knows all the computer names.

Sorry for the wrong wording: what I want is the DHCP client to send the 
hostname when a lease is requested, but I do not want to give dhclient 
any explicit hostname to be sent.

I want dhclient to read the hostname from `hostname` or from 
/etc/sysconfig/network or any other way, and use that name to send the 
hostname to DHCP server.

Thank you,
Timothy Madden