Bug 488975 - Send a hostname to DHCP server by default
Summary: Send a hostname to DHCP server by default
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Dan Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 510253 540887 676208 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-06 16:09 UTC by Bernie Innocenti
Modified: 2011-04-12 21:27 UTC (History)
8 users (show)

Fixed In Version: NetworkManager-0.8.3.996-1.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-02 01:50:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Bernie Innocenti 2009-03-06 16:09:41 UTC
This is required for networks setups where dhcpd uses DDNS to register
LAN clients in the local domain.

This functionality is supported by initscripts by setting the DHCP_HOSTNAME parameter in the ifcfg-XYZ file.

Comment 1 Dan Williams 2009-03-06 21:40:33 UTC
Would it be sufficient to send your current machine hostname to the DHCP server?  I'd planned on just sending the configured hostname (as long as it wasn't localhost.localdomain or localhost of course).  It's exceedingly unlikely that you'd use a different assigned hostname than the one you'd send to the DHCP server for DDNS.

Comment 2 Bernie Innocenti 2009-03-07 00:43:43 UTC
(In reply to comment #1)
> Would it be sufficient to send your current machine hostname to the DHCP
> server?  I'd planned on just sending the configured hostname (as long as it
> wasn't localhost.localdomain or localhost of course).  It's exceedingly
> unlikely that you'd use a different assigned hostname than the one you'd send
> to the DHCP server for DDNS.  

Yeah, that would be great.  One less manual customization to do on most enterprise clients :-)

Comment 3 Jessica Sterling 2009-03-08 19:17:00 UTC
This bug has been triaged.

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 4 Bug Zapper 2009-06-09 11:57:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Richard Henderson 2009-06-30 18:24:51 UTC
See also

  https://bugzilla.redhat.com/show_bug.cgi?id=508981

which this bug should probably block on, since the NM server
(though not the applet) already understands a
  NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME
which results in a "send host-name" in the dhcp config file.

Comment 6 Dan Williams 2010-04-13 23:14:36 UTC
*** Bug 510253 has been marked as a duplicate of this bug. ***

Comment 7 Dan Williams 2010-04-13 23:27:25 UTC
*** Bug 540887 has been marked as a duplicate of this bug. ***

Comment 8 Bug Zapper 2010-11-04 11:28:06 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Neal Becker 2010-11-04 14:11:29 UTC
Still an issue in F14

Comment 10 Jirka Klimes 2010-11-05 11:22:18 UTC
The feature has actually been implemented for a while already.
DHCP_HOSTNAME= from ifcfg files is respected and when present, NM will send the value to the DHCP server.
See these bugs for more info:
bug 469336   - detailed description how to enable sending hostname to DHCP
bug 590096   - describing a workaround - editing dhclient conf file 
bug 596242   - patch for nm-connection-editor to be able to handle the feature in the GUI (specifying a name or telling NM to use the persistent hostname)

The only deficiency is that "send-dhcp-hostname" property is set to "FALSE" by default. So, without adding DHCP_HOSTNAME to ifcfg file or adding "dhcp-hostname" via gconf-editor, the hostame won't be sent to DHCP.

This patch may be convenient:
diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c
index 186e41e..ec8de7c 100644
--- a/libnm-util/nm-setting-ip4-config.c
+++ b/libnm-util/nm-setting-ip4-config.c
@@ -950,7 +950,7 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class)
                                                   "the 'dhcp-hostname' property is empty and this "
                                                   "property is TRUE, the current persistent hostname "
                                                   "of the computer is sent.",
-                                                  FALSE,
+                                                  TRUE,
                                                   G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE));
 
        /**

It turns the feature *on* by default. The value sent would be:
- DHCP_HOSTNAME (or dhcp-hostame) if present
- else the persistent hostname (HOSTNAME in case of RH configuration)
- otherwise no hostname will be sent.

Comment 11 Neal Becker 2010-11-05 16:05:36 UTC
The issue I'm referring to, is that when a machine is initially setup, I know of no convenient way to get DHCP_HOSTNAME set _besides_ manually editing ifcfg files.  That requires much too high a level of expertise: to know which files to edit, make sure to edit them in a manner that preserves hard-links.

Comment 12 Peter F. Patel-Schneider 2010-12-02 03:18:41 UTC
What is it going to take to have the change in Comment 10 actually make its way into NetworkManager?  Or, alternatively, have some easy way of having the persistent hostname be sent on all DHCP interactions (that don't have something else specified)?

I've gotten used to adding the "magic" /etc/dhclient-eth0.conf and /etc/dhclient-wlan0.conf files, but just spent a while figuring out what went wrong on a new box.  The problem was that the box had eth1.  :-(

Comment 13 Neal Becker 2010-12-02 12:33:18 UTC
I just edit /etc/sysconfig/network-scripts/ifcfg-etho adding

DHCP_HOSTNAME=xxxyyy

being VERY careful to preserve hardlinks (emacs with backup-by-copying-when-linked t)

Comment 14 Peter F. Patel-Schneider 2010-12-02 13:35:15 UTC
The ifcfg route is quite similar to the dhclient route.  Both require editing a file for each piece of hardware.  As you say, it would be better to have a much easier way of sending the host name in DHCP interactions (ideally one with no user input).

The patch in Comment 10 appears to be a way of doing this.  My question remains is how to get this bug fix (or maybe it is an enhancement) into NetworkManager.
Perhaps the best route would be to start a thread in the NetworkManager mailing list.

Comment 15 Bug Zapper 2010-12-05 06:59:47 UTC
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 16 Jirka Klimes 2011-02-01 15:58:41 UTC
Reopened to change the default behaviour on sending hostname to DHCP server.

Comment 17 Jirka Klimes 2011-02-01 16:04:21 UTC
The following commit contains the patch from comment 10:
9f28308460ea5ab55db9b59690bf95fcd096c1bb (master)
9b61ec7c58e8106c28d01b33ad0b263aefb1f347 (NM_0_8)

So, when a hostname is configured, it is sent to DHCP server by default.

Comment 18 Fedora Update System 2011-02-24 06:05:27 UTC
NetworkManager-0.8.3.995-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/NetworkManager-0.8.3.995-1.fc14

Comment 19 Fedora Update System 2011-02-24 06:08:57 UTC
NetworkManager-0.8.3.995-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/NetworkManager-0.8.3.995-1.fc13

Comment 20 Fedora Update System 2011-02-24 20:56:44 UTC
NetworkManager-0.8.3.995-1.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update NetworkManager'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/NetworkManager-0.8.3.995-1.fc14

Comment 21 Dan Williams 2011-02-25 22:43:59 UTC
*** Bug 676208 has been marked as a duplicate of this bug. ***

Comment 22 Fedora Update System 2011-02-25 23:42:21 UTC
Package NetworkManager-0.8.3.996-1.fc14:
* should fix your issue,
* was pushed to the Fedora 14 updates-testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing NetworkManager-0.8.3.996-1.fc14'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/NetworkManager-0.8.3.996-1.fc14
then log in and leave karma (feedback).

Comment 23 Fedora Update System 2011-02-25 23:45:19 UTC
Package NetworkManager-0.8.3.996-1.fc13:
* should fix your issue,
* was pushed to the Fedora 13 updates-testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing NetworkManager-0.8.3.996-1.fc13'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/NetworkManager-0.8.3.996-1.fc13
then log in and leave karma (feedback).

Comment 24 Fedora Update System 2011-03-02 01:48:37 UTC
NetworkManager-0.8.3.996-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2011-03-03 09:46:41 UTC
Package NetworkManager-0.8.3.997-1.fc13:
* should fix your issue,
* was pushed to the Fedora 13 updates-testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing NetworkManager-0.8.3.997-1.fc13'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/NetworkManager-0.8.3.997-1.fc13
then log in and leave karma (feedback).

Comment 26 Neal Becker 2011-03-20 20:56:13 UTC
Can we please get this into F15?


rpm -q NetworkManager
NetworkManager-0.8.2-8.git20101117.fc15.x86_64

sudo yum --enablerepo=updates-testing update NetworkManager
[sudo] password for nbecker:
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Setting up Update Process
No Packages marked for Update

Comment 27 Fedora Update System 2011-03-25 03:29:33 UTC
NetworkManager-0.8.3.998-2.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/NetworkManager-0.8.3.998-2.fc13

Comment 28 Fedora Update System 2011-04-12 21:27:27 UTC
NetworkManager-0.8.3.998-2.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.