HP-UX IP Address and Client Management Administrator's Guide HP-UX 11i v2, HP-UX 11i v3

Configuring the Resolver to Set Timeout Values
You can configure the timeout value for clients that use DNS to resolve a host name. The timeout
value specifies the number of retransmissions of a query and the time (in milliseconds) between
each retransmission. The performance of the resolver improves with smaller timeout values. You
can configure the timeout values by defining environment variables, editing the
/etc/resolv.conf configuration file, or using the resolver APIs.
Configuring Timeout Values Using Environment Variables
You can set the retransmission value and the time between each retransmission by using the
environment variables RES_RETRY and RES_RETRANS, respectively. The valid values for the
RES_RETRY and RES_RETRANS environment variables are positive non-zero integers. By default,
the system attempts to retransmit 4 times, and the time interval between each retransmission is
5000 milliseconds.
NOTE: You can set the timeout values with the environment variables RES_RETRY and
RES_RETRANS only for individual clients.
If the environment variables RES_RETRY and RES_RETRANS contain invalid values, the default
values are set and an error message is logged in the /var/adm/syslog/syslog.log file.
To set the environment variables, type the following export commands at the HP-UX prompt:
# export RES_RETRY=1 # export RES_RETRANS=300
This sets the retransmission value to 1 and the time between each retransmission to 300
milliseconds. You can specify the export commands again to change the values for both the
environment variables. Do not specify a value less than 200 milliseconds for the RES_RETRANS
environment variable.
Configuring Timeout Values Using the Configuration File
You can specify the retransmission time and the time between each retransmission by using the
options retrans and retry, respectively, in the /etc/resolv.conf configuration file.
NOTE: You can set the timeout values in the configuration file /etc/resolv.conf only for
a specific system.
To set the timeout values, add the following lines to the /etc/resolv.conf configuration file
after the domain and name server entries.
retry 1 retrans 600
This sets the retransmission value to 1 and the time between each retransmission to 600
milliseconds.
Configuring Timeout Values Using APIs
You can configure the timeout values using the following APIs:
set_resfield()
get_resfield()
Using these two APIs, you can set and get values for the retransmission time and the time between
each retransmission in the instance of the a _res_state structure. When you configure the
timeout values using the APIs, you must make certain changes to the code and recompile the
code. The returned values of the APIs indicate if the specified values are correct.
The set_resfield() API
The syntax for the set_resfield function is as follows:
80 Configuring and Administering the BIND Name Service