LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-11-2011, 05:21 PM   #1
dafydd2277
Member
 
Registered: Mar 2010
Posts: 58

Rep: Reputation: 5
DNS lookups taking too long.


Good Morning!

This investigation started with an Oracle installation saying "Dude, you're bad host lookups are taking more than 15000 ms!" A followup (accidental) test came about when the master DNS server got shut off for longer than the zone files' Expire time.

=== The questions:

1) Of the 12 test look ups of a known bad hostname, only one returned "Host badhost not found: 2(SERVFAIL)" which I believe is the appropriate response. Why might that be?

2) Adding "option timeout" and "option attempts" to /etc/resolv.conf on the client side don't appear to change look up times in any material way. How can I speed up the SERVFAIL or time out responses from the server side?

=== The tests:

Let's start with two bind DNS servers. Call them "master" and "slave."

Both are:
RHEL 5.4
bind-9.3.6-4.P1.el5_5.3
bind-chroot-9.3.6-4.P1.el5_5.3

They handle a test network of three subdomains and one subnet. This network doesn't have access to the outside world, but has some 200 hosts in the test net.

Aside from the master/slave zoning, named.conf is identical for both hosts. I can look in slave:/var/named/chroot/var/named/slaves/ and see good copies of the master's zone files.

Test a known good host with both DNS servers running.
Code:
[root@testhost ~]# time host goodhost
goodhost.sub.dom.ain has address <goodhostIP>

real    0m0.003s
user    0m0.003s
sys     0m0.002s

[root@testhost ~]# time host goodhost <DNSmaster>
Using domain server:
Name: <DNSmaster>
Address: <DNSmaster>#53
Aliases:

goodhost.sub.dom.ain has address <goodhostIP>

real    0m0.003s
user    0m0.000s
sys     0m0.003s

[root@testhost ~]# time host goodhost <DNSslave>
Using domain server:
Name: <DNSslave>
Address: <DNSslave>#53
Aliases:

goodhost.sub.dom.ain has address <goodhostIP>

real    0m0.003s
user    0m0.002s
sys     0m0.000s
Test a non-existant hostname with both servers running.
Code:
[root@testhost ~]# time host badhost
;; connection timed out; no servers could be reached

real    0m12.013s
user    0m0.001s
sys     0m0.002s

[root@testhost ~]# time host badhost <DNSmaster>
Using domain server:
Name: <DNSmaster>
Address: <DNSmaster>#53
Aliases:

Host badhost not found: 2(SERVFAIL)

real    0m7.473s
user    0m0.000s
sys     0m0.002s

[root@testhost ~]# time host badhost <DNSslave>
;; connection timed out; no servers could be reached

real    0m14.015s
user    0m0.002s
sys     0m0.001s
Shutdown "slave" and repeat all six tests.
Code:
[root@testhost ~]# time host goodhost
goodhost.sub.dom.ain has address <goodhostIP>

real    0m3.008s
user    0m0.001s
sys     0m0.001s

[root@testhost ~]# time host goodhost <DNSmaster>
Using domain server:
Name: <DNSmaster>
Address: <DNSmaster>#53
Aliases:

goodhost.sub.dom.ain has address <goodhostIP>

real    0m0.003s
user    0m0.003s
sys     0m0.001s

[root@testhost ~]# time host goodhost <DNSslave>
Using domain server:
Name: <DNSmaster>
Address: <DNSmaster>#53
Aliases:

goodhost.sub.dom.ain has address <goodhostIP>

real    0m6.014s
user    0m0.000s
sys     0m0.002s

[root@testhost ~]# time host badhost
;; connection timed out; no servers could be reached

real    0m15.019s
user    0m0.002s
sys     0m0.000s

[root@testhost ~]# time host badhost <DNSmaster>
;; connection timed out; no servers could be reached

real    0m14.015s
user    0m0.001s
sys     0m0.001s

[root@testhost ~]# time host badhost <DNSslave>
;; connection timed out; no servers could be reached

real    0m20.029s
user    0m0.002s
sys     0m0.000s
Restart "slave" and stop "master." Re-run all six tests.
Code:
[root@testhost ~]# time host goodhost
goodhost.sub.dom.ain has address <goodhostIP>

real    0m0.004s
user    0m0.002s
sys     0m0.001s

[root@testhost ~]# time host goodhost <DNSmaster>
Using domain server:
Name: <DNSslave>
Address: <DNSslave>#53
Aliases:

goodhost.sub.dom.ain has address <goodhostIP>
real    0m3.009s
user    0m0.001s
sys     0m0.001s

[root@testhost ~]# time host goodhost <DNSslave>
Using domain server:
Name: <DNSslave>
Address: <DNSslave>#53
Aliases:

goodhost.sub.dom.ain has address <goodhostIP>

real    0m0.003s
user    0m0.001s
sys     0m0.001s

[root@testhost ~]# time host badhost
;; connection timed out; no servers could be reached

real    0m12.011s
user    0m0.002s
sys     0m0.000s

[root@testhost ~]# time host badhost <DNSmaster>
;; connection timed out; no servers could be reached

real    0m19.823s
user    0m0.001s
sys     0m0.001s

[root@testhost ~]# time host badhost <DNSslave>
;; connection timed out; no servers could be reached

real    0m14.016s
user    0m0.002s
sys     0m0.000s
 
Old 07-11-2011, 06:42 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Are "goodhost" and "badhost" FQDN's ? .. and if so is the domain part wrong or the host part wrong for "badhost"?
 
Old 07-11-2011, 11:48 PM   #3
dafydd2277
Member
 
Registered: Mar 2010
Posts: 58

Original Poster
Rep: Reputation: 5
goodhost and badhost are both simple host names. Goodhost exists in one of the three subdomains. Badhost is, literally, "badhost," and a hostname (so to speak) designed to fail.
 
  


Reply

Tags
dns


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow DNS Lookups JustinK101 Linux - Software 1 01-29-2007 06:48 PM
dns taking 2 lookups to work rustyz82 Linux - Networking 2 05-26-2006 07:39 AM
sendmail dns lookups davidsrsb Linux - Networking 1 06-09-2005 09:35 PM
Sendail and DNS lookups Hessian Rider Linux - Networking 3 11-05-2002 07:03 AM
Reverse DNS Lookups ascii2k Linux - Networking 2 08-08-2001 09:01 AM


All times are GMT -5. The time now is 10:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration