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.
Thank you, Timothy Madden
centos-bounces@centos.org schrieb am 29.11.2011 14:57:15:
Timothy Madden terminatorul@gmail.com Gesendet von: centos-bounces@centos.org
29.11.2011 14:57
Bitte antworten an CentOS mailing list centos@centos.org
An
centos@centos.org
Kopie
Thema
[CentOS] DHCP_HOSTNAME in ifcfg-eth0
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.
Thank you, Timothy Madden
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Hi Timothy, I've in my config file:
DHCP_CLIENT_ID=st00ni0029 DHCP_HOSTNAME=st00ni0029
That works for me.
Gruß Andreas Reschke ________________________________________________________________
Unix/Linux-Administration Andreas.Reschke@behrgroup.com
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.
For some reason I think you need to have "HOSTNAME=" in your /etc/sysconfig/network file .. meaning make the variable blank. There is also a dhclient option you can create in /etc/dhcp/dhclient-<int>.conf something like send fqdn.fqdn <hostname> but usually you don't need that if your use DHCP_HOSTNAME correctly ...
Barry
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
On Tue, Nov 29, 2011 at 05:52:06PM +0200, Timothy Madden wrote:
Currently I have to include a line like DHCP_HOSTNAME=appserver2
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.
Can't you just do DHCP_HOSTNAME=`hostname` ?
Many of the config files are just parsed as shell scripts, so this might work :-)
Sounds to me like you want to set up DDNS internally? I do that for my home network - but you need to have both DHCP and DNS working together...meaning DHCP needs to be able to update the DNS server with the names of the DHCP clients. I've got a Linksys router and have never gotten that to work with it (I haven't tried), but I have a CentOS box acting as both my DNS server and DHCP server. I also spin up VMs that use DHCP...my kickstart file actually write the DHCP client name into ifcfg-eth0, so when the DHCP clients start up I can refer to them by name...
On Tue, 29 Nov 2011, Timothy Madden wrote:
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
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Scot P. Floess RHCT (Certificate Number 605010084735240) Chief Architect FlossWare http://sourceforge.net/projects/flossware http://flossware.sourceforge.net https://github.com/organizations/FlossWare