After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 720077 - [dhcpcd] networkmanager does not pass hostname to router
[dhcpcd] networkmanager does not pass hostname to router
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
0.9.8
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-12-08 19:16 UTC by Erik Quaeghebeur
Modified: 2016-11-23 15:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Erik Quaeghebeur 2013-12-08 19:16:04 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]
Comment 1 Pavel Simerda 2013-12-09 07:11:12 UTC
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.
Comment 2 Erik Quaeghebeur 2013-12-09 09:16:41 UTC
(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.)
Comment 3 Pavel Simerda 2013-12-09 11:38:36 UTC
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.
Comment 4 Francesco Giudici 2016-11-23 15:07:07 UTC
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.