What is the maximum limit of domains in a DNS search list?

Solution Verified - Updated -

Environment

  • RHEL 5
  • RHEL 6
  • glibc package versions lower than glibc-2.17-222.el7

Issue

  • Need more than 6 domains in the resolv.conf search list.

  • Only the first 6 domains in the search path are looked up by the resolver.

Resolution

Upgrade glibc packages to versions be at or above glibc-2.17-222.el7.

Root Cause

The search list is currently limited to six domains with a total of 256 characters.

The limit is specified by glibc source at resolv/resolv.h as below:

 # define MAXDNSRCH              6 /* max # domains in search path */

This cannot be modified for RHEL 6.x and below and is resolved in RHEL7 glibc package versions at or exceeding glibc-2.17-222.el7.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.