Description of problem: NetworkManager does not set hostname when DHCP used. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Install fedora 15. 2. Ensure /etc/sysconfig/network file has not 'hostname' defined, so have only one line NETWORKING=yes Actual results: 'hostname' gives (none) and NetworkManager does not add hostname to /etc/hosts file. Expected results: Hostname should be imported from DHCP server. Works in Fedora 14. In messages file we can see the message 'Setting system hostname to... ... (from address lookup) Additional info:
Could you include your /var/log/messages file so that we can see the logs?
Created attachment 500454 [details] Messages file from boot.
Upstream fix for not using "(none)" as fallback value is 9eaf31f49a3dc579e7765f4774fdcbc79463f1be However, note that /etc/hosts is not handled by NM any more, and it is up to the administrator to set the file up properly. See the commit message for the rationale: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=39eed50e470d6f41222e40ce0276b898e8c84dc4 (In reply to comment #0) > Hostname should be imported from DHCP server. > Works in Fedora 14. In messages file we can see the message > 'Setting system hostname to... ... (from address lookup) "Setting system hostname to... ... (from address lookup)" message doesn't mean setting from DHCP server (because there's no host-name option in your case), but from DNS reverse lookup. Try $ dig -x <your IP>
Can't see much differences with command "dig -x <IP> outputs between F14 and F15. So can we summarize that this (NetworkManager does not set hostname) is expected behaviour now?
(In reply to comment #4) > Can't see much differences with command "dig -x <IP> outputs between F14 and > F15. There should not be any difference in the output. The command just performs reverse DNS lookup and shows you the hostname in ANSWER SECTION. > So can we summarize that this (NetworkManager does not set hostname) is > expected behaviour now? NetworkManager continues to set hostname (via system/library call sethostname()). And that could be checked by 'hostname' command. The only thing it ceased to do is touching /etc/hosts. The commit 9eaf31f49a3dc579e7765f4774fdcbc79463f1be fixes the case where the initial hostname was "(none)".
Yes, ANSWER SECTION shows hostname in both F14 and F15. Only difference is second column numbers (25294 vs. 28694). Does this matter?
(In reply to comment #6) > Yes, ANSWER SECTION shows hostname in both F14 and F15. > Only difference is second column numbers (25294 vs. 28694). > Does this matter? No. The number is time-to-live specifying how long DNS will cache the value yet. For a dig tutorial see e.g. http://www.madboa.com/geek/dig/ However, the dig command has not much to do with this bug. I just asked for the output to see if there was a hostname by reverse domain resolution.
NetworkManager-0.8.9997-4.git20110620.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/NetworkManager-0.8.9997-4.git20110620.fc15
Applied NetworkManager-0.8.9997-4.git20110620.fc15 and it resolves this bug issue i.e. hostname is correctly set now. Thank you!
Package NetworkManager-0.8.9997-4.git20110620.fc15: * should fix your issue, * was pushed to the Fedora 15 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.9997-4.git20110620.fc15' as soon as you are able to, then reboot. Please go to the following url: https://admin.fedoraproject.org/updates/NetworkManager-0.8.9997-4.git20110620.fc15 then log in and leave karma (feedback).
NetworkManager-0.8.9997-4.git20110620.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.