resolv.conf and slow resolving when first nameserver is down


I was wondering if someone here has found a good solution to this problem and is happy to share it with us.

Lately I am experiencing outages of my provider’s resolving nameservers at random.
At the point when the first nameserver in resolv.conf is failing, resolving becomes very slow (5+ seconds).
It seems like the built-in resolver in centos is slow noticing an outage of the nameserver.
This causes exim to stop working at all or just being very, very slow.

I have found a solution to this problem, but it is in my opinion not the best one, and hope to find a better one.


nameserver (ip #1 server)
nameserver (ip #2 server)
nameserver (ip #3 server)
nameserver (ip #4 server)

options timeout:1
options attempts:5
options rotate

=> see options timeout:1 and attempts:5

This helps a bit.
When the first server seems down, after 1 second it moves along to the second one.

However exim is still too slow in my opinion (+-3 seconds)
It still takes 3 seconds to send the code 220 with greeting, which should be faster in my opinion.

It seems like the built-in nameserver resolver client (or how do you call it) does not put a nameserver in down-state, and is as a result slow every time again when the first server is down.

And, oh, by the way, ‚options rotate’ does not work …. 🙁
It should pick a random nameserver, but it does not.
And this means, other servers specified in my resolv.conf file are ‚never’ used.

… or maybe it is time redhat improves the built-in resolver?

thank you for your time