1833187 Members
2659 Online
110051 Solutions
New Discussion

DNS with no retry

 
SOLVED
Go to solution
j773303
Super Advisor

DNS with no retry

#cat /etc/resolv.conf
domain twn.bb.com
nameserver 165.157.187.24
nameserver 165.149.3.243
---------------------------

From the above configuration, the DNS default would retry 4 times if nameserver no responding. My question is, is it possible configure "no retry" if nameserver no response?
That's primary DNS no responding, just query from secondary DNS immediately.

Another quesion: If configure retry is 1, do any good recommend value about "retrans" ?
Thanks.
Hero
4 REPLIES 4
Geoff Wild
Honored Contributor
Solution

Re: DNS with no retry

Default is 5000, try 25000 or 1000 for retrans...

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

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.
j773303
Super Advisor

Re: DNS with no retry

Hi Goff,
So, Is retry vaule hardcode in the resolver ? If Ping or ftp or telnet query primary DNS failed, it must be waiting for retry, then try to query the other nameserver ? Can if be set "no retry" ? Thanks in advanced.
Hero
Bill Hassell
Honored Contributor

Re: DNS with no retry

According to the man page, you can export some environment variables which will affect the resolver subsystem, or add the values after the IP address of the DNS server (man resolver). For env variables:

export RES_RETRANS=1000
export RES_RETRY=2

or for resolv.conf:

nameserver 165.157.187.24 retrans 1000 retry 2
nameserver 165.149.3.243 retrans 1000 retry 2

The precedence is env then resolv.conf and finally through the API.


Bill Hassell, sysadmin
Yaroslaw
Occasional Advisor

Re: DNS with no retry

Hi
Me too..
----
domain some_domain.com
nameserver IP_0 #<-- No DNS
nameserver IP_1
nameserver IP_2
-----

date && nslookup some && date

# Date2-Date1 = 20 sec.

2-----
export RES_RETRANS=1000
export RES_RETRY=2

# Date2-Date1=20 sec :(

3---
in resolv.conf:
domain some_domain.com
nameserver IP_0 retrans 1000 retry 2 #<-- No DNS
nameserver IP_1 retrans 1000 retry 2
nameserver IP_2 retrans 1000 retry 2

# Date2-Date1=20 sec =(