1*5bbd2a12SchristosRESOLVER(5) FreeBSD File Formats Manual RESOLVER(5) 2b5677b36Schristos 3b5677b36SchristosNNAAMMEE 4*5bbd2a12Schristos rreessoollvveerr -- resolver configuration file 5b5677b36Schristos 6b5677b36SchristosSSYYNNOOPPSSIISS 7b5677b36Schristos _/_e_t_c_/_r_e_s_o_l_v_._c_o_n_f 8b5677b36Schristos 9b5677b36SchristosDDEESSCCRRIIPPTTIIOONN 10*5bbd2a12Schristos The rreessoollvveerr is a set of routines in the C library (resolve(3)) that pro- 11*5bbd2a12Schristos vide access to the Internet Domain Name System. The rreessoollvveerr configura- 12b5677b36Schristos tion file contains information that is read by the rreessoollvveerr routines the 13b5677b36Schristos first time they are invoked by a process. The file is designed to be 14b5677b36Schristos human readable and contains a list of keywords with values that provide 15b5677b36Schristos various types of rreessoollvveerr information. 16b5677b36Schristos 17b5677b36Schristos On a normally configured system, this file should not be necessary. The 18b5677b36Schristos only name server to be queried will be on the local machine, the domain 19*5bbd2a12Schristos name is determined from the host name, and the domain search path is con- 20b5677b36Schristos structed from the domain name. 21b5677b36Schristos 22b5677b36Schristos The different configuration directives are: 23b5677b36Schristos 24b5677b36Schristos nameserver 25b5677b36Schristos Internet address (in dot notation) of a name server that the 26b5677b36Schristos rreessoollvveerr should query. Up to MAXNS (see _<_r_e_s_o_l_v_._h_>) name 27b5677b36Schristos servers may be listed, one per keyword. If there are multiple 28b5677b36Schristos servers, the rreessoollvveerr library queries them in the order listed. 29b5677b36Schristos If no nameserver entries are present, the default is to use the 30b5677b36Schristos name server on the local machine. (The algorithm used is to try 31b5677b36Schristos a name server, and if the query times out, try the next, until 32b5677b36Schristos out of name servers, then repeat trying all the name servers 33b5677b36Schristos until a maximum number of retries are made). 34b5677b36Schristos 35b5677b36Schristos domain Local domain name. Most queries for names within this domain 36b5677b36Schristos can use short names relative to the local domain. If no domain 37b5677b36Schristos entry is present, the domain is determined from the local host 38b5677b36Schristos name returned by gethostname; the domain part is taken to be 39*5bbd2a12Schristos everything after the first `.'. Finally, if the host name does 40b5677b36Schristos not contain a domain part, the root domain is assumed. 41b5677b36Schristos 42b5677b36Schristos search Search list for host-name lookup. The search list is normally 43b5677b36Schristos determined from the local domain name; by default, it contains 44b5677b36Schristos only the local domain name. This may be changed by listing the 45b5677b36Schristos desired domain search path following the search keyword with 46b5677b36Schristos spaces or tabs separating the names. Most rreessoollvveerr queries will 47b5677b36Schristos be attempted using each component of the search path in turn 48b5677b36Schristos until a match is found. Note that this process may be slow and 49b5677b36Schristos will generate a lot of network traffic if the servers for the 50b5677b36Schristos listed domains are not local, and that queries will time out if 51b5677b36Schristos no server is available for one of the domains. 52b5677b36Schristos 53b5677b36Schristos The search list is currently limited to six domains with a total 54b5677b36Schristos of 256 characters. 55b5677b36Schristos 56b5677b36Schristos sortlist 57b5677b36Schristos Allows addresses returned by gethostbyname to be sorted. A 58b5677b36Schristos sortlist is specified by IP address netmask pairs. The netmask 59b5677b36Schristos is optional and defaults to the natural netmask of the net. The 60b5677b36Schristos IP address and optional network pairs are separated by slashes. 61b5677b36Schristos Up to 10 pairs may be specified. For example: 62b5677b36Schristos 63b5677b36Schristos sortlist 130.155.160.0/255.255.240.0 130.155.0.0 64b5677b36Schristos 65b5677b36Schristos options Allows certain internal rreessoollvveerr variables to be modified. The 66b5677b36Schristos syntax is 67b5677b36Schristos options _o_p_t_i_o_n _._._. 68b5677b36Schristos where _o_p_t_i_o_n is one of the following: 69b5677b36Schristos 70b5677b36Schristos debug sets RES_DEBUG in ___r_e_s_._o_p_t_i_o_n_s. 71b5677b36Schristos 72b5677b36Schristos ndots:_n sets a threshold for the number of dots which must 73b5677b36Schristos appear in a name given to rreess__qquueerryy() (see 74b5677b36Schristos resolver(3)) before an _i_n_i_t_i_a_l _a_b_s_o_l_u_t_e _q_u_e_r_y will be 75*5bbd2a12Schristos made. The default for _n is ``1'', meaning that if 76*5bbd2a12Schristos there are _a_n_y dots in a name, the name will be tried 77*5bbd2a12Schristos first as an absolute name before any _s_e_a_r_c_h _l_i_s_t ele- 78*5bbd2a12Schristos ments are appended to it. 79b5677b36Schristos 80b5677b36Schristos timeout:_n 81b5677b36Schristos sets the amount of time the resolver will wait for a 82b5677b36Schristos response from a remote name server before retrying the 83*5bbd2a12Schristos query via a different name server. Measured in sec- 84b5677b36Schristos onds, the default is RES_TIMEOUT (see _<_r_e_s_o_l_v_._h_>). 85b5677b36Schristos 86b5677b36Schristos attempts:_n 87b5677b36Schristos sets the number of times the resolver will send a 88*5bbd2a12Schristos query to its name servers before giving up and return- 89b5677b36Schristos ing an error to the calling application. The default 90b5677b36Schristos is RES_DFLRETRY (see _<_r_e_s_o_l_v_._h_>). 91b5677b36Schristos 92b5677b36Schristos rotate sets RES_ROTATE in ___r_e_s_._o_p_t_i_o_n_s, which causes round 93b5677b36Schristos robin selection of nameservers from among those 94b5677b36Schristos listed. This has the effect of spreading the query 95b5677b36Schristos load among all listed servers, rather than having all 96b5677b36Schristos clients try the first listed server first every time. 97b5677b36Schristos 98b5677b36Schristos no-check-names 99b5677b36Schristos sets RES_NOCHECKNAME in ___r_e_s_._o_p_t_i_o_n_s, which disables 100b5677b36Schristos the modern BIND checking of incoming host names and 101b5677b36Schristos mail names for invalid characters such as underscore 102b5677b36Schristos (_), non-ASCII, or control characters. 103b5677b36Schristos 104b5677b36Schristos inet6 sets RES_USE_INET6 in ___r_e_s_._o_p_t_i_o_n_s. This has the 105b5677b36Schristos effect of trying a AAAA query before an A query inside 106b5677b36Schristos the _g_e_t_h_o_s_t_b_y_n_a_m_e function, and of mapping IPv4 107*5bbd2a12Schristos responses in IPv6 ``tunnelled form'' if no AAAA 108b5677b36Schristos records are found but an A record set exists. 109b5677b36Schristos 110b5677b36Schristos no-tld-query 111b5677b36Schristos sets RES_NOTLDQUERY in ___r_e_s_._o_p_t_i_o_n_s. This option 112b5677b36Schristos causes rreess__nnsseeaarrcchh() to not attempt to resolve a 113b5677b36Schristos unqualified name as if it were a top level domain 114b5677b36Schristos (TLD). This option can cause problems if the site has 115b5677b36Schristos "localhost" as a TLD rather than having localhost on 116b5677b36Schristos one or more elements of the search list. This option 117b5677b36Schristos has no effect if neither RES_DEFNAMES or RES_DNSRCH is 118b5677b36Schristos set. 119b5677b36Schristos 120b5677b36Schristos The domain and search keywords are mutually exclusive. If more than one 121b5677b36Schristos instance of these keywords is present, the last instance wins. 122b5677b36Schristos 123*5bbd2a12Schristos The search keyword of a system's _r_e_s_o_l_v_._c_o_n_f file can be overridden on a 124*5bbd2a12Schristos per-process basis by setting the environment variable ``LOCALDOMAIN'' to 125*5bbd2a12Schristos a space-separated list of search domains. 126b5677b36Schristos 127*5bbd2a12Schristos The options keyword of a system's _r_e_s_o_l_v_._c_o_n_f file can be amended on a 128*5bbd2a12Schristos per-process basis by setting the environment variable ``RES_OPTIONS to a 129*5bbd2a12Schristos space-separated list of'' rreessoollvveerr options as explained above under 130b5677b36Schristos options. 131b5677b36Schristos 132b5677b36Schristos The keyword and value must appear on a single line, and the keyword 133b5677b36Schristos (e.g., nameserver) must start the line. The value follows the keyword, 134b5677b36Schristos separated by white space. 135b5677b36Schristos 136b5677b36SchristosFFIILLEESS 137b5677b36Schristos _/_e_t_c_/_r_e_s_o_l_v_._c_o_n_f _<_r_e_s_o_l_v_._h_> 138b5677b36Schristos 139b5677b36SchristosSSEEEE AALLSSOO 140*5bbd2a12Schristos gethostbyname(3), hostname(7), resolver(3), resolver(5). ``Name Server 141*5bbd2a12Schristos Operations Guide for BBIINNDD'' 142b5677b36Schristos 143b5677b36Schristos4th Berkeley Distribution November 11, 1993 4th Berkeley Distribution 144