Bug 1415886

Summary: Need to set "fqdn.server-update" and "fqdn.encoded on" in dhclient-<nic>.conf off?
Product: Red Hat Enterprise Linux 7 Reporter: Jonathan Maxwell <jmaxwell>
Component: NetworkManagerAssignee: sushil kulkarni <sukulkar>
Status: CLOSED NOTABUG QA Contact: Desktop QE <desktop-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.3CC: atragler, bgalvani, fgiudici, lrintel, rkhan, sukulkar, thaller
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-06 23:33:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1416031    

Description Jonathan Maxwell 2017-01-24 01:21:13 UTC
Description of problem:

Recently this functionality:

# cat /var/lib/NetworkManager/dhclient-ens256.conf
# Created by NetworkManager

send fqdn.fqdn "www.test.com"; # added by NetworkManager
send fqdn.encoded on;
send fqdn.server-update on;

Was added as per:

https://bugzilla.redhat.com/show_bug.cgi?id=1255507

Quoting the customer:

"With RHEL 6, I was able to add these lines to /etc/dhcp/dhclient-eth0.conf:

send fqdn.fqdn "servername.example.com";
send fqdn.server-update off;

There is a section in the dhclient.conf man page on Dynamic DNS. It's not very clear, but setting these two settings does the trick.

With RHEL 7, I'd like to configure the network using NetworkManager. I tried setting:

nmcli con mod "System eth0" ipv4.dhcp-fqdn servername.example.com

This adds the send fqdn.fqdn line in /var/lib/NetworkManager/dhclient-eth0.conf, but sets "send fqdn.encoded on" and "send fqdn.server-update on". I'd like both of these settings to be set to off.

Any ideas if this can be done?"

Version-Release number of selected component (if applicable):

RHEL7.3.
NetworkManager-1.4.0-14.el7_3.x86_64

How reproducible:

Always:

# nmcli con mod ens256 ipv4.dhcp-fqdn www.test.com
# nmcli connection up ens256

Actual results:

# cat /var/lib/NetworkManager/dhclient-ens256.conf
# Created by NetworkManager

send fqdn.fqdn "www.test.com"; # added by NetworkManager
send fqdn.encoded on;
send fqdn.server-update on;

Expected results:

Is there a way to change "fqdn.encoded" and "fqdn.server-update" to off from NetworkManager? 

Additional info:

Looking at the source code this seems to be hard coded and only the fqdn name seems variable, which is why I added this request:

dhcp-manager/nm-dhcp-dhclient-utils.c

 58 add_hostname4 (GString *str, const char *hostname, const char *fqdn)↩
 59 {↩
 60 ▹       char *plain_hostname, *dot;↩
 61 ↩
 62 ▹       if (fqdn) {↩
 63 ▹       ▹       g_string_append_printf (str, FQDN_FORMAT "\n", fqdn);↩
 64 ▹       ▹       g_string_append (str,↩
 65 ▹       ▹                        "send fqdn.encoded on;\n"↩
 66 ▹       ▹                        "send fqdn.server-update on;\n");↩
 67 ▹       } else if (hostname) {↩

Assuming I have not missed a configuration option, can these be made configurable as they were on RHEL6?

Comment 1 Beniamino Galvani 2017-01-24 08:30:08 UTC
(In reply to Jonathan Maxwell from comment #0)
> Is there a way to change "fqdn.encoded" and "fqdn.server-update" to off from
> NetworkManager? 

The "fqdn.fqdn" option is always overridden by NetworkManager to honor the "ip4v.dhcp-fqdn" property of the active connection. The "fqdn.encoded" and "fqdn.server-update" options can be set by users directly in /etc/dhcp/dhclient-*.conf and they will be added at the end of the generated configuration file:

# nmcli con mod ens256 ipv4.dhcp-fqdn www.test.com

# cat > /etc/dhcp/dhclient-ens256.conf << EOF
send fqdn.encoded off;
send fqdn.server-update off;
EOF

# nmcli connection up ens256

# cat /var/lib/NetworkManager/dhclient-ens256.conf
 # Created by NetworkManager
 # Merged from /etc/dhcp/dhclient-ens256.conf

 send fqdn.fqdn "www.test.com"; # added by NetworkManager
 send fqdn.encoded on;
 send fqdn.server-update on;

 option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
 option ms-classless-static-routes code 249 = array of unsigned integer 8;
 option wpad code 252 = string;

 also request rfc3442-classless-static-routes;
 also request ms-classless-static-routes;
 also request static-routes;
 also request wpad;
 also request ntp-servers;

 # FQDN options from /etc/dhcp/dhclient-ens256.conf
 send fqdn.encoded off;
 send fqdn.server-update off;

Comment 3 Jonathan Maxwell 2017-01-25 22:35:39 UTC
(In reply to Beniamino Galvani from comment #1)
> (In reply to Jonathan Maxwell from comment #0)
> > Is there a way to change "fqdn.encoded" and "fqdn.server-update" to off from
> > NetworkManager? 
> 
> The "fqdn.fqdn" option is always overridden by NetworkManager to honor the
> "ip4v.dhcp-fqdn" property of the active connection. The "fqdn.encoded" and
> "fqdn.server-update" options can be set by users directly in
> /etc/dhcp/dhclient-*.conf and they will be added at the end of the generated
> configuration file:
> 
> # nmcli con mod ens256 ipv4.dhcp-fqdn www.test.com
> 
> # cat > /etc/dhcp/dhclient-ens256.conf << EOF
> send fqdn.encoded off;
> send fqdn.server-update off;
> EOF
> 
> # nmcli connection up ens256
> 
> # cat /var/lib/NetworkManager/dhclient-ens256.conf
>  # Created by NetworkManager
>  # Merged from /etc/dhcp/dhclient-ens256.conf
> 
>  send fqdn.fqdn "www.test.com"; # added by NetworkManager
>  send fqdn.encoded on;
>  send fqdn.server-update on;
> 
>  option rfc3442-classless-static-routes code 121 = array of unsigned integer
> 8;
>  option ms-classless-static-routes code 249 = array of unsigned integer 8;
>  option wpad code 252 = string;
> 
>  also request rfc3442-classless-static-routes;
>  also request ms-classless-static-routes;
>  also request static-routes;
>  also request wpad;
>  also request ntp-servers;
> 
>  # FQDN options from /etc/dhcp/dhclient-ens256.conf
>  send fqdn.encoded off;
>  send fqdn.server-update off;

Thanks for the suggestion. We tried this and found:

"I tried what you suggested and it did the right thing by adding those entries to the end of /var/lib/NetworkManager/dhclient-ethX.conf, but the dhclient still does not perform dynamic DNS updates.

I suspect it's not working because the config file has two entries for these settings, and that it's picking up the first one."

The customer is going to run a test on RHEL6 which was working and see if duplicate parameters causes the same behaviour. We will let you know the result of that test.

Regards

Jon

Comment 4 Jonathan Maxwell 2017-02-06 23:33:08 UTC
I am closing this bz as the customer confirmed that dhclient works RHEL6. A workaround was provided to update the dhclient-ethX.conf file on RHEL7. But on RHEL7 even with the same /var/lib/NetworkManager/dhclient-ethX.conf file as RHEL6, dynamic DNS fails. They stopped NetworkManager and got the same behaviour on RHEL7. So this looks like a dhclient issue. 

Thanks for your help.