Linux – resolv.conf search suffix limited to six domains and 256 characters

domain-name-systemlinuxnameserverresolv.conf

Is there a way to increase the resolv.conf search suffix limitation beyond six domains and 256 characters? This is an issue for an environment that has well over six domains to consider.

I realize that having more suffixes will delay resolution in many cases, but there are "timeout" and "attempts" parameters that could deal with this, I assume.

Best Answer

libc must be recompiled after redefining MAXDNSRCH and defdname in resolv.h in the package, and then re-packaged. Do not modify /usr/include/resolv.h, but rather resolv.h in the package which delivers it.

For example, if one is on an RPM-based operating system, one would download the .srpm, install it locally, modify the source code, re-archive it and rebuild the .srpm and .rpm packages, upload the .rpm into the Yellowdog Update Manager ("YUM") repository and mass-upgrade the libc package on all affected systems. The .srpm would, after regression testing, be committed into one's local source code repository and the changes documented in the commit log as well as the build release document. Although this example used RPM, this applies to all operating systems which support packages.

Anything less than this, and one is looking at a hack instead of doing clean system engineering.