(E-Mail Removed) (Floyd L. Davidson) wrote:
> Henrik Carlqvist <(E-Mail Removed)> wrote:
>> For some reason it seems as if the system waits for all servers to
>> answer even if the first server gives a correct answer.
> But in any event the first one is the only one that will ever be queried
> if the first query is successful,
Thats what one might expect, but I have seen examples of when queries go
to all servers listed even though the first one gives a correct answer and
I have seen this slow down DNS queries when some DNS server is down even
if the first server is up.
It did come as a surpries to me when running strace to see that all
servers were queried even though the first server gave the right answer.
Now, when trying to recreate that I only got partial success. I have no
DNS server running on localhost:
-8<---------------------
bash-3.1# cat /etc/resolv.conf
# Generated by dhcpcd for interface wlan0
search Belkin
nameserver 192.168.30.254
bash-3.1# dig
www.google.com @192.168.30.254
; <<>> DiG 9.4-ESV-R4-P1 <<>>
www.google.com @192.168.30.254
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16474
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;
www.google.com. IN A
;; ANSWER SECTION:
www.google.com. 86400 IN A 209.85.169.105
;; Query time: 98 msec
;; SERVER: 192.168.30.254#53(192.168.30.254)
;; WHEN: Sat Oct 15 19:39:55 2011
;; MSG SIZE rcvd: 48
bash-3.1# dig
www.google.com @127.0.0.1
; <<>> DiG 9.4-ESV-R4-P1 <<>>
www.google.com @127.0.0.1
;; global options: printcmd
;; connection timed out; no servers could be reached
bash-3.1# time nslookup
www.google.com
Server: 192.168.30.254
Address: 192.168.30.254#53
Name:
www.google.com
Address: 209.85.169.105
real 0m0.104s
user 0m0.004s
sys 0m0.004s
bash-3.1# emacs -nw /etc/resolv.conf
bash-3.1# cat /etc/resolv.conf
# Generated by dhcpcd for interface wlan0
search Belkin
nameserver 192.168.30.254
nameserver 127.0.0.1
bash-3.1# time nslookup
www.google.com
;; Got recursion not available from 192.168.30.254, trying next server
;; connection timed out; no servers could be reached
real 0m15.113s
user 0m0.004s
sys 0m0.000s
-8<---------------------
In the example above "nslookup www.google.com" takes 0.1s with a single
working nameserver in resolv.conf. Adding a broken nameserver increases
that time to 15s and also gives no answer. This test was done on Slackware
12.2.
The above example does not behave exactly as I remembered the problem, but
at least it shows there is something fishy with nslookup.
regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc123(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost