GNOME Bugzilla – Bug 720077
[dhcpcd] networkmanager does not pass hostname to router
Last modified: 2016-11-23 15:07:07 UTC
I have a (wifi) router (adsl modem). I connect with two computers, one a desktop, without NetworkManager, another a laptop, with NetworkManager (both run gentoo linux). For both, the hostname is set in /etc/conf.d/hostname, both have stock /etc/dhcpcd.conf and /etc/hosts files (in which the hostname does not appear). The router gets the hostname of the desktop, but not the one of the laptop. Reproducible: Always Actual Results: did not pass the hostname to the router Expected Results: pass the hostname to the router The router log tells me (first line is desktop, second is laptop): 12.01.13 10:09:39 WLAN station registered. Name: <desktop hostname>, IP address: 192.168.178.32, MAC address: <snipped>, throughput: 54 MBit/s. 12.01.13 09:58:03 WLAN station registered. Name: -, IP address: 192.168.178.35, MAC address: <snipped>, throughput: 54 MBit/s. I tried modifying /etc/dhcpcd.conf (adding the hostname or commenting the disabling of hostname-lookup) and /etc/NetworkManager/NetworkManager.conf (adding a hostname line to a new [keyfile] section), both suggestions I found in the forums, but to no avail. I'd prefer a setup where routers can override hostnames if they wish, as the laptop is also used in corporate networks where this is sometimes required. N.B.: My android phone also does not pass its hostname (but I don't need it to, I don't think I even set its hostname). [earlier gentoo bugreport: https://bugs.gentoo.org/show_bug.cgi?id=451510]
Hi, this is specific to dhcpcd users, which are a minority of NetworkManager users. My advice is to *always* use NetworkManager with dhclient whose support is much better tested. Leaving the bug report open for those interested in dhcpcd.
(In reply to comment #1) > Hi, this is specific to dhcpcd users, which are a minority of NetworkManager > users. My advice is to *always* use NetworkManager with dhclient whose support > is much better tested. I understand that you do not want to support multiple dhcp cliens. However, what needs to be done concretely to diagnose and fix this issue? For example, how is the hostname passed on to the router when using dhclient? (This information may be useful to, e.g., the dhcpcd developer to contribute a fix to NetworkManager.)
For dhclient, NetworkManager generates a configuration file (and allows other configuration to be merged in) that is then used by dhcpcd. Then dhclient includes that information in the DHCP protocol exchange and uses an executable supplied by NetworkManager to give back information from the DHCP answer.
Looking at the code in NM, hostname retrieval has been unified in the dhcp client plugins code. Now the hostname should be correctly passed also when using dhcpcd client, with the -h option. So, in recent NM versions this should be fixed. Closing. Please, reopen if needed.