Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
The _collect_resolv_conf_data() function limits the number of search entries to 6 within the following code snippet. Taken from the 1.10.2-16 source revision:
/* Per 'man resolv.conf', the search list is limited to 6 domains
* totalling 256 characters.
*/
num = MIN (rc.searches->len, 6u);
for (i = 0, len = 0; i < num; i++) {
len += strlen (rc.searches->pdata[i]) + 1; /* +1 for spaces */
if (len > 256)
break;
}
g_ptr_array_set_size (rc.searches, i);
This is no longer the limit for later RHEL releases. The limit was removed with the efforts in RHBZ677316 [^1] and released in upstream glibc-2.26 [^2].
Version-Release number of selected component (if applicable):
# rpm -q NetworkManager
NetworkManager-1.10.2-16.el7_5.x86_64
How reproducible:
Easily
Steps to Reproduce:
1. Set an interface to a ipv4.dns-search entry greater than 6
# nmcli con modify System\ eth0 ipv4.dns-search $(echo {a..g}.redhat.com, | sed -e 's/ //g' -e 's/,$//g')
2. Verify the ipv4.dns-search field includes more than 6 entries
# nmcli con show System\ eth0 | grep ipv4.dns-search
ipv4.dns-search: a.redhat.com,b.redhat.com,c.redhat.com,d.redhat.com,e.redhat.com,f.redhat.com,g.redhat.com
3. Issue an "nmcli con up <interface>" and verify that the /etc/resolv.conf has more than 6 entries
# nmcli con up System\ eth0
# grep search /etc/resolv.conf
Actual results:
search a.redhat.com b.redhat.com c.redhat.com d.redhat.com e.redhat.com f.redhat.com
Expected results:
search a.redhat.com b.redhat.com c.redhat.com d.redhat.com e.redhat.com f.redhat.com g.redhat.com
Additional info:
The problem is not seen when disabling NetworkManager and falling back to the underlying network initscripts.
# systemctl stop NetworkManager && systemctl restart network && grep search
/etc/resolv.conf
search a.redhat.com b.redhat.com c.redhat.com d.redhat.com e.redhat.com f.redhat.com g.redhat.com
The problem is also present with the latest available upstream NetworkManager revision [^3].
[^1]: https://bugzilla.redhat.com/show_bug.cgi?id=677316
[^2]: https://sourceware.org/ml/libc-alpha/2017-08/msg00010.html
[^3]: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/blob/master/src/dns/nm-dns-manager.c#L1132
As a workaround the NetworkManager global-dns 'searches=' option is not limited to 6 search domains.
WORKAROUND
==========
Create a file in /etc/NetworkManager/conf.d/*.conf and add these entries:
[main]
dns=default
[global-dns]
searches=one.example.com two.example.com three.example.com four.example.com five.example.com six.example.com seven.example.com eight.example.com
[global-dns-domain-*]
servers=xxx.xxx.xxx.xxx
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2019:2302
Description of problem: The _collect_resolv_conf_data() function limits the number of search entries to 6 within the following code snippet. Taken from the 1.10.2-16 source revision: /* Per 'man resolv.conf', the search list is limited to 6 domains * totalling 256 characters. */ num = MIN (rc.searches->len, 6u); for (i = 0, len = 0; i < num; i++) { len += strlen (rc.searches->pdata[i]) + 1; /* +1 for spaces */ if (len > 256) break; } g_ptr_array_set_size (rc.searches, i); This is no longer the limit for later RHEL releases. The limit was removed with the efforts in RHBZ677316 [^1] and released in upstream glibc-2.26 [^2]. Version-Release number of selected component (if applicable): # rpm -q NetworkManager NetworkManager-1.10.2-16.el7_5.x86_64 How reproducible: Easily Steps to Reproduce: 1. Set an interface to a ipv4.dns-search entry greater than 6 # nmcli con modify System\ eth0 ipv4.dns-search $(echo {a..g}.redhat.com, | sed -e 's/ //g' -e 's/,$//g') 2. Verify the ipv4.dns-search field includes more than 6 entries # nmcli con show System\ eth0 | grep ipv4.dns-search ipv4.dns-search: a.redhat.com,b.redhat.com,c.redhat.com,d.redhat.com,e.redhat.com,f.redhat.com,g.redhat.com 3. Issue an "nmcli con up <interface>" and verify that the /etc/resolv.conf has more than 6 entries # nmcli con up System\ eth0 # grep search /etc/resolv.conf Actual results: search a.redhat.com b.redhat.com c.redhat.com d.redhat.com e.redhat.com f.redhat.com Expected results: search a.redhat.com b.redhat.com c.redhat.com d.redhat.com e.redhat.com f.redhat.com g.redhat.com Additional info: The problem is not seen when disabling NetworkManager and falling back to the underlying network initscripts. # systemctl stop NetworkManager && systemctl restart network && grep search /etc/resolv.conf search a.redhat.com b.redhat.com c.redhat.com d.redhat.com e.redhat.com f.redhat.com g.redhat.com The problem is also present with the latest available upstream NetworkManager revision [^3]. [^1]: https://bugzilla.redhat.com/show_bug.cgi?id=677316 [^2]: https://sourceware.org/ml/libc-alpha/2017-08/msg00010.html [^3]: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/blob/master/src/dns/nm-dns-manager.c#L1132