Operating System - HP-UX
1820880 Members
3553 Online
109628 Solutions
New Discussion юеВ

DNS retry every 5 seconds ?

 
SOLVED
Go to solution
dictum9
Super Advisor

DNS retry every 5 seconds ?


How do I modify /etc/nsswitch.conf to retry DNS lookup every 5 seconds?
3 REPLIES 3
Geoff Wild
Honored Contributor
Solution

Re: DNS retry every 5 seconds ?

Not in nsswitch.conf - but in resolv.conf...

The default is 5 seconds...

In Unix, we always check the first DNS server in resolv.conf - which means every DNS lookup will fail ( and wait 5 seconds and try 4 times!!) if that server is down.

So, in resolv.conf, a setting of:

retrans 2500
retry 2

Will timeout after 2.5 seconds and only retry the same server twice.



From man page:

retrans

Retransmission timeout. It is interpreted during
the res_init() (see resolver(3N)) call. It has
higher precedence than setting it through the
set_resfeild() (see resolver(3N)) API and lower
precedence than setting it through the RES_RETRANS
(see resolver(3N)) environment variable. Whenever
an invalid value is specified for retrans, a
message is flagged in syslog. The default value
is 5000 milliseconds.

retry

Number of retries. This is interpreted during the
res_init() (see resolver(3N)) call. It has higher
precedence than setting it through the
set_resfeild() (see resolver(3N)) API and lower
precedence than setting it through the RES_RETRY
(see resolver(3N)) environment variable. Whenever
an invalid value is specified for retry, a message
is flagged in syslog. The default value is 4.


That will speed up any delays going from 1 nameserver to another - unfortunately, Windows does a better job - if it can't get to the first one, it goes to the second - if successful, it's next query will automatically go to the second. In unix, this is not the case - we will always try the nameservers in order based on resolv.conf.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Peter Godron
Honored Contributor

Re: DNS retry every 5 seconds ?

have a look at
man 4 resolver
you can change /etc/resolv.conf
Arunvijai_4
Honored Contributor

Re: DNS retry every 5 seconds ?

Hi ETC,

The default is 5 secs and you need to edit /etc/resolv.conf for modifying.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"