Environment variables
You can use environment variables to override default initialization of resolver functions.
Environment variables are only checked after a successful call to res_init() or res_ninit(). So if the structure has been manually initialized, environment variables are ignored. Also note that the structure is only initialized once so later changes to the environment variables are ignored.
LOCALDOMAIN
Set this environment variable to a space-separated list of up to six search domains with a total of 256 characters (including spaces). This overrides the configured search list (struct state.defdname and struct state.dnsrch). If a search list is specified, the default local domain is not used on queries.
RES_OPTIONS
The RES_OPTIONS environment variable allows certain internal resolver variables to be modified. The environment variable can be set to one or more of the following space-separated options:
- NDOTS: n Sets a threshold for the number of dots that must appear in a name given to res_query() before an initial absolute query is made. The default for n is 1, meaning that if there are any dots in a name, the name is tried first as an absolute name before any search list elements are appended to it.
- TIMEOUT: n Sets the amount of time (in seconds) that the resolver waits for a response from a remote name server before giving up and trying the query again.
- ATTEMPTS: n Sets the number of queries that the resolver sends to a given nameServer before giving up and trying the next listed name server.
- ROTATE: Sets RES_ROTATE in _res.options, which rotates the selection of nameServers from among those listed. This has the effect of spreading the query load among all listed servers, rather than having all clients try the first listed server first every time.
- NO-CHECK-NAMES: Sets RES_NOCHECKNAME in _res.options, which disables the modern BIND checking of incoming host names and mail names for invalid characters such as underscore (_), non-ASCII, or control characters.
QIBM_BIND_RESOLVER_FLAGS
Set this environment variable to a space separated list of resolver option flags. This overrides the RES_DEFAULT options (struct state.options) and system configured values (Change TCP/IP Domain - CHGTCPDMN). The state options structure is initialized normally, using RES_DEFAULT, OPTIONS environment values and CHGTCPDMN configured values. Then this environment variable is used to override those defaults. The flags named in this environment variable might be prepended with a '+', '-' or 'NOT_' to set ('+') or reset ('-','NOT_') the value.
For example, to turn on RES_NOCHECKNAME and turn off RES_ROTATE, use the following command from a character-based interface:
ADDENVVAR ENVVAR(QIBM_BIND_RESOLVER_FLAGS) VALUE('RES_NOCHECKNAME NOT_RES_ROTATE')or
ADDENVVAR ENVVAR(QIBM_BIND_RESOLVER_FLAGS) VALUE('+RES_NOCHECKNAME -RES_ROTATE')QIBM_BIND_RESOLVER_SORTLIST
Set this environment variable to a space-separated list of up to ten IP addresses/mask pairs in dotted decimal format (9.5.9.0/255.255.255.0) to create a sort list (struct state.sort_list).