{
    "mode": "man",
    "parameter": "RESOLV.CONF",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/RESOLV.CONF/5/json",
    "generated": "2026-10-22T14:27:53Z",
    "synopsis": "",
    "sections": {
        "NAME": {
            "content": "resolv.conf - resolver configuration file\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "",
            "subsections": [
                {
                    "name": "/etc/resolv.conf",
                    "content": ""
                }
            ]
        },
        "DESCRIPTION": {
            "content": "The resolver is a set of routines in the C library that provide access to the Internet Domain\nName  System (DNS).  The resolver configuration file contains information that is read by the\nresolver routines the first time they are invoked by a process.  The file is designed  to  be\nhuman  readable and contains a list of keywords with values that provide various types of re‐\nsolver information.  The configuration file is considered a trusted source  of  DNS  informa‐\ntion; see the trust-ad option below for details.\n\nIf  this  file does not exist, only the name server on the local machine will be queried, and\nthe search list contains the local domain name determined from the hostname.\n\nThe different configuration options are:\n\nnameserver Name server IP address\nInternet address of a name server that the resolver should query, either an  IPv4  ad‐\ndress  (in  dot  notation), or an IPv6 address in colon (and possibly dot) notation as\nper RFC 2373.  Up to MAXNS (currently 3, see <resolv.h>) name servers may  be  listed,\none  per keyword.  If there are multiple servers, the resolver library queries them in\nthe order listed.  If no nameserver entries are present, the default  is  to  use  the\nname server on the local machine.  (The algorithm used is to try a name server, and if\nthe  query  times out, try the next, until out of name servers, then repeat trying all\nthe name servers until a maximum number of retries are made.)\n\nsearch Search list for host-name lookup.\nBy default, the search list contains one entry, the local domain name.  It  is  deter‐\nmined  from  the  local  hostname returned by gethostname(2); the local domain name is\ntaken to be everything after the first '.'.  Finally, if the hostname does not contain\na '.', the root domain is assumed as the local domain name.\n\nThis may be changed by listing the desired domain search  path  following  the  search\nkeyword  with spaces or tabs separating the names.  Resolver queries having fewer than\nndots dots (default is 1) in them will be attempted using each component of the search\npath in turn until a match is found.  For environments with multiple subdomains please\nread options ndots:n below to avoid man-in-the-middle attacks and unnecessary  traffic\nfor  the root-dns-servers.  Note that this process may be slow and will generate a lot\nof network traffic if the servers for the listed  domains  are  not  local,  and  that\nqueries will time out if no server is available for one of the domains.\n\nIf  there  are multiple search directives, only the search list from the last instance\nis used.\n\nIn glibc 2.25 and earlier, the search list is limited to six domains with a  total  of\n256 characters.  Since glibc 2.26, the search list is unlimited.\n\nThe  domain  directive  is  an obsolete name for the search directive that handles one\nsearch list entry only.\n",
            "subsections": [
                {
                    "name": "sortlist",
                    "content": "This option allows addresses returned by gethostbyname(3) to be sorted.  A sortlist is\nspecified by IP-address-netmask pairs.  The netmask is optional and  defaults  to  the\nnatural  netmask  of the net.  The IP address and optional network pairs are separated\nby slashes.  Up to 10 pairs may be specified.  Here is an example:\n\nsortlist 130.155.160.0/255.255.240.0 130.155.0.0\n"
                },
                {
                    "name": "options",
                    "content": "Options allows certain internal resolver variables to be modified.  The syntax is\n\noptions option ...\n\nwhere option is one of the following:\n\ndebug  Sets RESDEBUG in res.options (effective only if glibc was  built  with  debug\nsupport; see resolver(3)).\n\nndots:n\nSets  a  threshold  for the number of dots which must appear in a name given to\nresquery(3) (see resolver(3)) before an initial absolute query will  be  made.\nThe  default for n is 1, meaning that if there are any dots in a name, the name\nwill be tried first as an absolute name before any search list elements are ap‐\npended to it.  The value for this option is silently capped to 15.\n\ntimeout:n\nSets the amount of time the resolver will wait for a  response  from  a  remote\nname  server  before  retrying the query via a different name server.  This may\nnot be the total time taken by any resolver API call and there is no  guarantee\nthat a single resolver API call maps to a single timeout.  Measured in seconds,\nthe  default  is RESTIMEOUT (currently 5, see <resolv.h>).  The value for this\noption is silently capped to 30.\n\nattempts:n\nSets the number of times the resolver will send a query to its name servers be‐\nfore giving up and returning an error to the calling application.  The  default\nis  RESDFLRETRY  (currently  2, see <resolv.h>).  The value for this option is\nsilently capped to 5.\n\nrotate Sets RESROTATE in res.options, which causes  round-robin  selection  of  name\nservers  from  among  those listed.  This has the effect of spreading the query\nload among all listed servers, rather than having all  clients  try  the  first\nlisted server first every time.\n\nno-aaaa (since glibc 2.36)\nSets RESNOAAAA in res.options, which suppresses AAAA queries made by the stub\nresolver,  including  AAAA  lookups  triggered  by NSS-based interfaces such as\ngetaddrinfo(3).  Only DNS lookups are affected: IPv6 data in hosts(5) is  still\nused,  getaddrinfo(3)  with  AIPASSIVE  will still produce IPv6 addresses, and\nconfigured IPv6 name servers are still used.  To  produce  correct  Name  Error\n(NXDOMAIN)  results,  AAAA queries are translated to A queries.  This option is\nintended preliminary for diagnostic purposes, to rule out that AAAA DNS queries\nhave adverse impact.  It is incompatible with EDNS0 usage and DNSSEC validation\nby applications.\n\nno-check-names\nSets RESNOCHECKNAME in res.options, which disables the modern  BIND  checking\nof  incoming hostnames and mail names for invalid characters such as underscore\n(), non-ASCII, or control characters.\n\ninet6  Sets RESUSEINET6 in res.options.  This has the  effect  of  trying  an  AAAA\nquery  before  an  A query inside the gethostbyname(3) function, and of mapping\nIPv4 responses in IPv6 \"tunneled form\" if no AAAA records are found  but  an  A\nrecord  set  exists.  Since glibc 2.25, this option is deprecated; applications\nshould use getaddrinfo(3), rather than gethostbyname(3).\n\nSome programs behave strangely when this option is turned on.\n\nip6-bytestring (since glibc 2.3.4 to glibc 2.24)\nSets RESUSEBSTRING in res.options.  This causes reverse IPv6  lookups  to  be\nmade  using  the  bit-label format described in RFC 2673; if this option is not\nset (which is the default), then nibble format is used.  This  option  was  re‐\nmoved  in  glibc 2.25, since it relied on a backward-incompatible DNS extension\nthat was never deployed on the Internet.\n\nip6-dotint/no-ip6-dotint (glibc 2.3.4 to glibc 2.24)\nClear/set  RESNOIP6DOTINT  in  res.options.   When  this  option   is   clear\n(ip6-dotint),  reverse  IPv6 lookups are made in the (deprecated) ip6.int zone;\nwhen this option is set (no-ip6-dotint), reverse IPv6 lookups are made  in  the\nip6.arpa  zone by default.  These options are available up to glibc 2.24, where\nno-ip6-dotint is the default.  Since ip6-dotint support long ago ceased  to  be\navailable on the Internet, these options were removed in glibc 2.25.\n\nedns0 (since glibc 2.6)\nSets  RESUSEEDNS0  in  res.options.  This enables support for the DNS exten‐\nsions described in RFC 2671.\n\nsingle-request (since glibc 2.10)\nSets RESSNGLKUP in res.options.  By default, glibc  performs  IPv4  and  IPv6\nlookups  in parallel since glibc 2.9.  Some appliance DNS servers cannot handle\nthese queries properly and make the requests time out.   This  option  disables\nthe  behavior  and  makes glibc perform the IPv6 and IPv4 requests sequentially\n(at the cost of some slowdown of the resolving process).\n\nsingle-request-reopen (since glibc 2.9)\nSets RESSNGLKUPREOP in res.options.  The resolver uses the  same  socket  for\nthe  A  and AAAA requests.  Some hardware mistakenly sends back only one reply.\nWhen that happens the client system will sit and wait  for  the  second  reply.\nTurning  this  option on changes this behavior so that if two requests from the\nsame port are not handled correctly it will close the socket and open a new one\nbefore sending the second request.\n\nno-tld-query (since glibc 2.14)\nSets RESNOTLDQUERY in res.options.  This option causes resnsearch()  to  not\nattempt  to resolve an unqualified name as if it were a top level domain (TLD).\nThis option can cause problems if the site has ``localhost'' as  a  TLD  rather\nthan  having localhost on one or more elements of the search list.  This option\nhas no effect if neither RESDEFNAMES or RESDNSRCH is set.\n\nuse-vc (since glibc 2.14)\nSets RESUSEVC in res.options.  This option forces the use of TCP for DNS res‐\nolutions.\n\nno-reload (since glibc 2.26)\nSets RESNORELOAD in res.options.  This option disables automatic reloading of\na changed configuration file.\n\ntrust-ad (since glibc 2.31)\nSets RESTRUSTAD in res.options.  This option controls the AD bit behavior  of\nthe  stub resolver.  If a validating resolver sets the AD bit in a response, it\nindicates that the data in the response was verified according  to  the  DNSSEC\nprotocol.   In  order to rely on the AD bit, the local system has to trust both\nthe DNSSEC-validating resolver and the network path to it, which is why an  ex‐\nplicit opt-in is required.  If the trust-ad option is active, the stub resolver\nsets  the  AD  bit in outgoing DNS queries (to enable AD bit support), and pre‐\nserves the AD bit in responses.  Without this option, the AD bit is not set  in\nqueries,  and  it  is always removed from responses before they are returned to\nthe application.  This means that applications can trust  the  AD  bit  in  re‐\nsponses if the trust-ad option has been set correctly.\n\nIn  glibc  2.30 and earlier, the AD is not set automatically in queries, and is\npassed through unchanged to applications in responses.\n\nThe search keyword of a system's resolv.conf file can be overridden on a per-process basis by\nsetting the environment variable LOCALDOMAIN to a space-separated list of search domains.\n\nThe options keyword of a system's resolv.conf file can be amended on a per-process  basis  by\nsetting the environment variable RESOPTIONS to a space-separated list of resolver options as\nexplained above under options.\n\nThe  keyword  and value must appear on a single line, and the keyword (e.g., nameserver) must\nstart the line.  The value follows the keyword, separated by white space.\n\nLines that contain a semicolon (;) or hash character (#) in the first column are  treated  as\ncomments.\n"
                }
            ]
        },
        "FILES": {
            "content": "/etc/resolv.conf, <resolv.h>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "gethostbyname(3),   resolver(3),   host.conf(5),   hosts(5),  nsswitch.conf(5),  hostname(7),\nnamed(8)\n\nName Server Operations Guide for BIND\n\n4th Berkeley Distribution                    2023-10-31                               resolv.conf(5)",
            "subsections": []
        }
    },
    "summary": "resolv.conf - resolver configuration file",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "gethostbyname",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/gethostbyname/3/json"
        },
        {
            "name": "resolver",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/resolver/3/json"
        },
        {
            "name": "host.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/host.conf/5/json"
        },
        {
            "name": "hosts",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/hosts/5/json"
        },
        {
            "name": "nsswitch.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/nsswitch.conf/5/json"
        },
        {
            "name": "hostname",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/hostname/7/json"
        },
        {
            "name": "named",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/named/8/json"
        },
        {
            "name": "resolv.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/resolv.conf/5/json"
        }
    ]
}