Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We've got a farm of centos5 boxes, which were configured by default to do DNS lookup via our host's internal DNS servers.

As of today, these lookups are failing about 10% of the time -- the default 5 second DNS lookup expires (sometimes up to 4 times in a row), and then we finally get a response (so operations that require a DNS lookup take 5, 10, 15, or 20 seconds to respond).

My question is, is there some way to count successful/timed out DNS lookups in centos/linux? I'd love to monitor this, so I'm not taken by surprise again when things start taking 5 seconds longer than they should.

share|improve this question
    
Do you already have an internal monitoring system? What are you using already? Would a check from your monitoring system against the internal DNS servers work for you? Nagios has a nice dns check that can send a request and check that the results were valid and returned quickly. –  Zoredache Aug 23 '12 at 21:50
    
Using nagios. It's looking like we will probably just use something like check_dns to run test queries. I worry, though, that this won't give us much visibility into situations like the current one, where 10% of requests fail. –  Frank Farmer Aug 23 '12 at 21:56
    
Apparently our host rate-limits DNS requests. It's a bit alarming that a simple 1-request-per-second test was able to trip this limit. This lends itself to answering both of my problems however: we may install our own DNS proxy which we can then (1) monitor and (2) receive reliable service from –  Frank Farmer Aug 24 '12 at 18:28
add comment

1 Answer

Another approach would be to modify your /etc/resolv.conf to:

  • Lower the timeout period (add options timeout 1) or...

  • Perform round-robin lookups (add options rotate) to distribute the DNS queries.

Either option is better than waiting 5 for seconds per resolver timeout.

Of course, those are only stopgap measures. Why is your host's DNS failing at such a high rate?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.