ipconfig: send host-name in DHCP requests
Subsystems (6)
PATCH 1/1 ipconfig: send host-name in DHCP requests
Normally dhclient can be configured to send the "host-name" option in DHCP requests to update the client's DNS record. However for an NFSROOT system, dhclient shall never be called (which may change the IP addr and therefore lose your root NFS mount connection).
So enable updating the DNS record with kernel parameter
ip=::::$HOST_NAME::dhcp
--- net/ipv4/ipconfig.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
net/ipv4/ipconfig.c +7 -0
@@ -665,6 +665,13 @@ ic_dhcp_init_options(u8 *options)memcpy (e, ic_req_params,sizeof (ic_req_params)); e +=sizeof (ic_req_params); +if (ic_host_name_set) { + *e++ =12 ;/* host-name */ + len =strlen (utsname ()->nodename); + *e++ = len; +memcpy (e,utsname ()->nodename, len); + e += len; + }if (*vendor_class_identifier) {printk (KERN_INFO "DHCP: sending class identifier \"%s\"\n" , vendor_class_identifier);
Signature · 1 line
1.6.6
From: Wu Fengguang <[email protected]>
Date: Mon, 31 May 2010 11:19:53 +0800
Quoted 10 lines
Normally dhclient can be configured to send the "host-name" option in DHCP requests to update the client's DNS record. However for an NFSROOT system, dhclient shall never be called (which may change the IP addr and therefore lose your root NFS mount connection).
So enable updating the DNS record with kernel parameter
ip=::::$HOST_NAME::dhcpSigned-off-by Wu Fengguang <[email protected]>
Applied, thanks.
Quoted 8 lines · David Miller
From: Wu Fengguang <[email protected]>
Date: Mon, 31 May 2010 11:19:53 +0800Quoted 5 lines
Normally dhclient can be configured to send the "host-name" option in DHCP requests to update the client's DNS record. However for an NFSROOT system, dhclient shall never be called (which may change the IP addr and therefore lose your root NFS mount connection).
Quoted 7 lines
Quoted 5 lines
So enable updating the DNS record with kernel parameter
ip=::::$HOST_NAME::dhcpSigned-off-by Wu Fengguang <[email protected]>Applied, thanks.
Small nit: Fengguang, please document the new option in Documentation/kernel-parameters.txt That could be done in a follow-on patch.
-Andi
Quoted 1 line
Signature · 1 line
[email protected] -- Speaking for myself only.
PATCH 1/1 ipconfig: document DHCP hostname and DNS record
Quoted 11 lines · Andi Kleen
Quoted 10 lines · David Miller
From: Wu Fengguang <[email protected]>
Date: Mon, 31 May 2010 11:19:53 +0800Quoted 7 lines
Normally dhclient can be configured to send the "host-name" option in DHCP requests to update the client's DNS record. However for an NFSROOT system, dhclient shall never be called (which may change the IP addr and therefore lose your root NFS mount connection).
So enable updating the DNS record with kernel parameter
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
ip=::::$HOST_NAME::dhcpSigned-off-by Wu Fengguang <[email protected]>Applied, thanks.
Small nit: Fengguang, please document the new option in
Documentation/kernel-parameters.txtThat could be done in a follow-on patch.
Good suggestion! Here is the document update.
Thanks,
Fengguang
---
ipconfig: document DHCP hostname and DNS record
Now it's possible to update the DNS record for $HOST_NAME with
ip=::::$HOST_NAME::dhcp
--- Documentation/filesystems/nfs/nfsroot.txt | 2 ++ 1 file changed, 2 insertions(+)
Documentation/filesystems/nfs/nfsroot.txt +2 -0
@@ -124,6 +124,8 @@ ip=<client-ip>:<server-ip>:<gw-ip>:<netm <hostname> Name of the client. May be supplied by autoconfiguration, but its absence will not trigger autoconfiguration. + If specified and DHCP is used, the user provided hostname will + be carried in the DHCP request to hopefully update DNS record. Default: Client IP address is used in ASCII notation.
Re: [PATCH] ipconfig: document DHCP hostname and DNS record
From: Wu Fengguang <[email protected]>
Date: Thu, 3 Jun 2010 10:02:44 +0800
Quoted 8 lines
ipconfig: document DHCP hostname and DNS record
Now it's possible to update the DNS record for $HOST_NAME with
ip=::::$HOST_NAME::dhcpCC Andi Kleen <[email protected]>Signed-off-by Wu Fengguang <[email protected]>
Applied.