Bug 756347 - Hostname not set correctly from dhcp.
Summary: Hostname not set correctly from dhcp.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 16
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: dracut-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-23 10:54 UTC by Ian Dall
Modified: 2012-01-23 11:31 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-23 11:31:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch to dracut version of dhclient-script to set fqdn (678 bytes, patch)
2011-11-23 10:54 UTC, Ian Dall
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 755921 0 unspecified CLOSED dhclient called with invalid hostname 2021-02-22 00:41:40 UTC

Internal Links: 755921

Description Ian Dall 2011-11-23 10:54:09 UTC
Created attachment 535417 [details]
Patch to dracut version of dhclient-script to set fqdn

Description of problem:
When booting with nfsroot, dracut doesn't necessarily set the initial hostname correctly.

Version-Release number of selected component (if applicable):
dracut-network-013-18.fc16

How reproducible:
Always

Steps to Reproduce:
1.On a dhcp server configure option host-name = short; option domain-name example.domain; 
2. Boot client with systemd.unit=rescue.target
3. /bin/hostname
  
Actual results:
short

Expected results:
short.example.domain

Additional info:
According to dhcp-options(5), the name may or may not be qualified with the local domain. It goes on to say "it is preferable to use the domain-name option to specify the domain name".

So dhclient-script needs to be able to handle the cases: a) where host-name is fully qualified and domain name is also specified; b) where hostname is fully qualified and the domain is not separately specified; c) where host-name is "short" and domain-name is also specified; and d) do its best where host-name is short but domain-name is not specified.

The dhclient-script in initramfs does not handle case "c", apparently the preferred situation properly, setting hostname to "short".

Patch attached.

Comment 1 Harald Hoyer 2012-01-23 11:31:50 UTC
dracut-014-61.git20120123.fc17


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