Bug 1415886 - Need to set "fqdn.server-update" and "fqdn.encoded on" in dhclient-<nic>.conf off?
Summary: Need to set "fqdn.server-update" and "fqdn.encoded on" in dhclient-<nic>.conf...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: NetworkManager
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: sushil kulkarni
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks: glusterfs-3.10.0
TreeView+ depends on / blocked
 
Reported: 2017-01-24 01:21 UTC by Jonathan Maxwell
Modified: 2020-04-15 15:08 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-06 23:33:08 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.