Bugzilla – Bug 557720
NetworkManager doesn't registers host in the network via DHCP
Last modified: 2012-11-16 05:58:16 UTC
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091103 SUSE/3.5.5-2.2 Firefox/3.5.5 When my NIC is controlled by "traditional methods" (ifup, ifdown), my computer gets known in the network by its name, i.e. mynotebook.mydomain is a valid address, and it is updated via DHCP. However, when I use NetworkManager, I still get a valid IP address via DHCP, but DNS is not get updated causing me some troubles. Let me know if you need an additional information. Thank you. Reproducible: Always Steps to Reproduce: 1. Go to Yast -> Network Settings -> Global Options 2. Choose 'Traditional method with ifup in Network Setup Method 3. Hit Ok. 4. Host is now known in the network. 5. Go to Yast -> Network Settings -> Global Options 6. Choose 'User controlled with NetworkManager' 7. Hit Ok. 8. Host is no longer known in the network. Actual Results: Host name is correctly registered in the network when using ifup and is not registered when using NM Expected Results: Host name should be correctly registered using both methods. It is advised to perform steps 1-4 and 5-8 using different network outlets, for clean results.
What is the exact problem? Pardon me, but I don't clearly understand what 'host name should be correctly registered' means. Is your machine's hostname not updated when you are using DHCP, or is DNS not working? Or do you use send host-name in /etc/dhclient.conf to send your hostname to the DNS server?
I was looking for the same problem when I found this bug-report that is still open due to missing info. The problem is the following. Inside Yast, Network Settings, Hostname/DNS, I put "mypcname" in the hostname field. If now I use ifup (as described above) when I login my pc get the name "mypcname", for example if I open a terminal I see "username@mypcname:~>". Instead if I use Networkmanager, my pc does not get the name I set as hostname. Again opening a terminal I see "username@localhost:~>". I hope now the problem is clear.
(In reply to comment #0) > User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) > Gecko/20091103 SUSE/3.5.5-2.2 Firefox/3.5.5 > > When my NIC is controlled by "traditional methods" (ifup, ifdown), my computer > gets known in the network by its name, i.e. mynotebook.mydomain is a valid > address, and it is updated via DHCP. > > However, when I use NetworkManager, I still get a valid IP address via DHCP, > but DNS is not get updated causing me some troubles. > > Let me know if you need an additional information. > > Thank you. > > Reproducible: Always > > Steps to Reproduce: > 1. Go to Yast -> Network Settings -> Global Options > 2. Choose 'Traditional method with ifup in Network Setup Method > 3. Hit Ok. > 4. Host is now known in the network. > 5. Go to Yast -> Network Settings -> Global Options > 6. Choose 'User controlled with NetworkManager' > 7. Hit Ok. > 8. Host is no longer known in the network. > Actual Results: > Host name is correctly registered in the network when using ifup and is not > registered when using NM > > Expected Results: > Host name should be correctly registered using both methods. > > It is advised to perform steps 1-4 and 5-8 using different network outlets, for > clean results. Any further information?
The problem is the following: When using networkmanager the hostname is not sent as part of the dhcp-request. Therefore, the dhcp-server can't tell the DNS-Server the name of the client, which in turn makes the client invisible in the local newtork network. So when I am connected via nm and then ssh to a server in the local network I can't resolve my IP-Address: user@client > ssh server user@server > echo $SSH_CLIENT 192.168.1.84 36066 22 user@server > host 192.168.1.84 Host 84.1.168.192.in-addr.arpa. not found: 3(NXDOMAIN) Workaround is to add send host-name "clientname"; to the /etc/dhclient.conf file. But as the comment in that file says: # Note, that hostname is usually sent using -H option So networkmanager should use the -H option when using /sbin/dhclient.
The problem is still there in openSUSE 11.4. And Jazz Fan's workaround still works :)
Now the NetworkManager already support this, but just the function is false by default. /** * NMSettingIP4Config:dhcp-send-hostname: * * If TRUE, a hostname is sent to the DHCP server when acquiring a lease. * Some DHCP servers use this hostname to update DNS databases, essentially * providing a static hostname for the computer. If * #NMSettingIP4Config:dhcp-hostname is empty and this property is TRUE, * the current persistent hostname of the computer is sent. **/ g_object_class_install_property (object_class, PROP_DHCP_SEND_HOSTNAME, g_param_spec_boolean (NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, "Send DHCP hostname", "If TRUE, a hostname is sent to the DHCP server when " "acquiring a lease. Some DHCP servers use this " "hostname to update DNS databases, essentially " "providing a static hostname for the computer. If " "the 'dhcp-hostname' property is empty and this " "property is TRUE, the current persistent hostname " "of the computer is sent.", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); We can change it but only for user connections: Use gconf-editor 1. /system/networking/connections/<num>/ipv4 2. right-click in properties area -> New Key... 3. add "dhcp-hostname" as String set to your value 4. add "dhcp-send-hostname" as Boolean set True Then reclick the connection which your edit. To verify it, just cat /var/run/nm-dhclient-eth1.conf (Maybe different name).You'll view the "send host-name xxxx" was add by NetworkManager. For system connections, currently the suse plugin for NM still don't support it yet.
The upstream already fixed this issue. Set the default value to true. commit 9f28308460ea5ab55db9b59690bf95fcd096c1bb Author: Jiří Klimeš <jklimes@redhat.com> Date: Tue Feb 1 16:47:04 2011 +0100 libnm-util: make NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME property TRUE by default (rh #488975) That lets NM send a hostname to DHCP server without requiring the user editing the parameter manually (there no GUI for this either). diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c index 186e41e..ec8de7c 100644 --- a/libnm-util/nm-setting-ip4-config.c +++ b/libnm-util/nm-setting-ip4-config.c @@ -950,7 +950,7 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) "the 'dhcp-hostname' property is empty and this " "property is TRUE, the current persistent hostname " "of the computer is sent.", - FALSE, + TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_SERIALIZE)); /**
Maintenance, Could we let it in the updates? Thanks!
for me it is okay +1
is sensible. +1
And it should be same issue for bnc#404663, I'll also update this in 11.3.
The SWAMPID for this issue is 41130. This issue was rated as low. Please submit fixed packages until 2011-06-23. Also create a patchinfo file using this link: https://swamp.suse.de/webswamp/wf/41130
update started.
Done. 71599 State:new By:BinLi When:2011-05-27T07:49:59 submit: home:BinLi:branches:openSUSE:11.4:Update:Test/NetworkManager -> openSUSE:11.4:Update:Test Descr: send dhcp-hostname to server by default(bnc#557720,swampid#41130)
This is an autogenerated message for OBS integration: This bug (557720) was mentioned in https://build.opensuse.org/request/show/71599 11.4 / NetworkManager
update released.
Update released for: NetworkManager, NetworkManager-debuginfo, NetworkManager-debugsource, NetworkManager-devel, NetworkManager-doc, NetworkManager-glib, NetworkManager-glib-debuginfo, NetworkManager-lang Products: openSUSE 11.3 (debug, i586, x86_64) openSUSE 11.4 (debug, i586, x86_64)
Sorry guys, but I just installed the patch (openSUSE 11.4 x86_64) and it still doesn't work. I still need my workaround in Comment 5 in order for my hostname to be propagated to my company's DNS.
Jazz, Could you attach your /var/run/nm-dhclient-eth0.conf (Maybe different name)? You'll view the "send host-name xxxx" was add by NetworkManager. Thanks!
Created attachment 433452 [details] /var/run/nm-dhclient-eth0.conf in case of no workaround As far as I can see it is essentially a copy of /etc/dhclient.conf. Only comments and indentation differ.
Jazz, From your log, it's true the send-hostname still not here, and I've upgrade to 0.8.9997, it all looks fine. Maybe we need another patch for this. Just check it.
Jazz, I've test in my machine, the original patch works fine, without the patch I can't view the 'send hostname ...', when apply the patch I can view the hostname was set like below. send host-name "xxxx.site"; # added by NetworkManager A little weird why it can't work for. Do you have other DHCP server for testing? Thanks!
Jazz, Could get the NetworkManager package from my repo? http://download.opensuse.org/repositories/home:/BinLi:/branches:/openSUSE:/11.4:/Update:/Test/standard Then run 'NetworkManager --no-daemon' in one terminal, you will view more log with the debug.patch, such as "hostname is ...." Thanks!
Created attachment 445302 [details] Networkmanager logfile Hi Bin, I Installed Networkmanager from your Repo (although it is Version 0.8.2 not 0.8.9997 as you said earlier). There is no "send host-name" in /var/run/nm-dhclient-eth0.conf. "ps ax | grep dhclient" gives: /sbin/dhclient -d -4 -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /var/run/dhclient-eth0.pid -lf /var/lib/dhcp/dhclient-a3cd26a5-94d4-4778-b9bc-b24e5bcf8bea-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0 I also tried to change "DHCLIENT_HOSTNAME_OPTION" option in /etc/sysconfig/network/dhcp from the default AUTO to my actual hostname, without success (this probably affects the traditional connection mode only anyway). I attached the (edited) messages to stderr from "NetworkManager --no-daemon".
Hi, I see this in OpenSUSE 12.1. (NM 0.9.1.90-4.3.1) In comment #8 it was said that this was fixed upstream. Did come too late for 12.1? Do we override this when building? As this breaks expected behaviour for users ( I actually tried to debug my dhcpd ddns setup before looking at the client) we should fix this. cheers Chris ps in nm-dhclient-eth0.conf I see some comments about "send host-name" including one that says it usually done with -H. But no actual "send host-name".
No activity for more that 1 1/2y and 11.4 is dead. I will close... please open a new bug if it happens against 12.2 (current stable)