RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1350602 - Change to initscripts causes dhclient to always send hostname to server via -H, even if it was not set
Summary: Change to initscripts causes dhclient to always send hostname to server via -...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: initscripts
Version: 6.8
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: David Kaspar // Dee'Kej
QA Contact: Jan Ščotka
Clayton Spicer
URL:
Whiteboard:
: 1396940 (view as bug list)
Depends On:
Blocks: 1356047 1385492 1398686 1410429
TreeView+ depends on / blocked
 
Reported: 2016-06-27 20:28 UTC by Steve Muskiewicz
Modified: 2017-03-21 11:53 UTC (History)
4 users (show)

Fixed In Version: initscripts-9.03.57-1
Doc Type: Bug Fix
Doc Text:
The "dhclient" command no longer incorrectly uses `localhost` when `hostname` is not set The "dhclient" command incorrectly sent `localhost` to the DHCP server as the host name when the `hostname` variable was not set. This has been fixed, and "dhclient" no longer sends an incorrect host name in these situations.
Clone Of:
: 1398686 (view as bug list)
Environment:
Last Closed: 2017-03-21 11:53:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0786 0 normal SHIPPED_LIVE initscripts bug fix update 2017-03-21 12:49:53 UTC

Description Steve Muskiewicz 2016-06-27 20:28:36 UTC
Description of problem:
It appears that an update to initscripts from RHEL 6.7 to 6.8 changed the behavior of dhclient.  Previously if the hostname was not set, the -H <hostname> option was not included in the dhclient args, but now it looks like it always (??) is, which can result in "localhost" getting sent to the DHCP server as a hostname.   Not sure if this is the desired behavior.  

It is possible this is a result of how our provisioning environment works.  What we do is clone a VM that does not have a hostname defined, then rely on a DHCP reservation (based on MAC address) to set the proper IP address.  Then when the VM comes up, it does a reverse DNS lookup and the hostname ends up getting set as expected.  With the update to RHEL 6.8, this still works, *however* I'm guessing that the logic that sets the hostname from the IP address is happening *after* the dhclient args are determined, because even though the hostname is set as expected, I still see the dhclient args as "dhclient -H localhost ... " AND I end up with the DNS PTR record of "localhost" pointing back to the IP address.  So then if I reboot the VM again, it now comes up as "localhost" due to the PTR record change.  (Yes I know that's a little loosy goosy allowing DNS records to get overwritten but that's how our DNS infra is now)


Version-Release number of selected component (if applicable):
initscripts-9.03.53-1

How reproducible:

100%

Steps to Reproduce:
1. Setup RHEL install with no hostname set in /etc/sysconfig/network (also make sure there is no DHCP_HOSTNAME defined in /etc/sysconfig/network-scripts/ifcfg-ethX)
2. Ensure it gets a known IP address that reverse maps to a valid hostname in DNS
3. Boot RHEL, the hostname is set properly from the reverse lookup, BUT the dhclient args are still "dhclient -H localhost  ..." and the PTR record has changed to "localhost"
4. Reboot again, now the hostname is "localhost" instead of the expected name from the DNS reverse lookup

Actual results:

dhclient sends "localhost" as its name to the DHCP server

Expected results:

dhclient should either send the hostname it used from the reverse lookup -or- not send the '-H <name>' argument at all.

Additional info:

Looks like this line in network-scripts/ifup-eth is responsible for the change:

    DHCLIENTARGS="${DHCLIENTARGS} -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${ONESHOT} -q ${DHCLIENTCONF} -lf /var/lib/dhclient/dhclient-${DEVICE}.leases -pf /var/run/dhclient-${DEVICE}.pid"

Comment 2 Lukáš Nykrýn 2016-06-29 08:43:16 UTC
Related bug https://bugzilla.redhat.com/show_bug.cgi?id=1070253

Comment 3 Lukáš Nykrýn 2016-06-29 09:55:30 UTC
Yeah we should change the behavior, maybe we can hook it with need_hostname and don't send the hostname if it return true. devel_Ack for 6.9

Comment 5 David Kaspar // Dee'Kej 2016-11-10 12:11:47 UTC
Fix proposed for review:
https://github.com/fedora-sysv/initscripts/pull/35

Comment 7 David Kaspar // Dee'Kej 2016-11-15 13:47:18 UTC
Pull-request merged:
https://github.com/fedora-sysv/initscripts/pull/38

Comment 9 David Kaspar // Dee'Kej 2016-11-21 10:40:05 UTC
*** Bug 1396940 has been marked as a duplicate of this bug. ***

Comment 20 errata-xmlrpc 2017-03-21 11:53:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0786.html


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