I am experimenting with two local DNS server. When I take down the second (or the primary) dns server, I can not resolve any domain name.
Using host
command or nslookup
I get time out error :
root@ubuntu:~# host testsrv.lan
;; connection timed out; no servers could be reached
root@ubuntu:~# nslookup testsrv.lan
;; Got recursion not available from 10.0.3.4, trying next server
;; connection timed out; no servers could be reached
But when I try dig
command I get a correct answer :
root@ubuntu:~# dig testsrv.lan
; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> testsrv.lan
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7759
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available
;; QUESTION SECTION:
;testsrv.lan. IN A
;; ANSWER SECTION:
testsrv.lan. 5 IN A 10.0.3.4
;; Query time: 2 msec
;; SERVER: 10.0.3.4#53(10.0.3.4)
;; WHEN: Thu Jun 04 17:54:28 CET 2015
;; MSG SIZE rcvd: 56
(primary DNS server is 10.0.3.4 and I have added an A recorde : testsrv.lan --> 10.0.3.4)
I have used tcpdump to check what is happening under the hood :
tcpdump -vvv -l -n -i any "udp port 53"
I have noticed that the first server is responding correctly to the dns request from my host but the host is always trying to request the second server and timing out.
Isn't ubuntu (specifically resolvconf service) supposed to be "fault tolerant" when any of the two DNS servers is down ? is this the default behavior when resolving a domain name ? is it docummented any where ? can we change ?
N.B: I am using ubuntu 14.04 server and the DNS is configured using /etc/network/interface dns-nameservers 10.0.3.4 10.0.3.5
Any help is appreciated. Thank you.