NetworkManager limits the search field of resolv.conf to 6 entries in _collect_resolv_conf_data()
The _collect_resolv_conf_data() function limits the number of search entries to 6 within the following code snippet.
/* 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 glibc releases as noted in glibc-2.26 1.
- The GNU C Library now supports an arbitrary number of search domains
(configured using the “search” directive in /etc/resolv.conf);
previously, there was a hard limit of six domains. For backward
compatibility, applications that directly modify the ‘_res’ global
object are still limited to six search domains.