4

The tinydns and dnscache services are running and I have 127.0.0.1 in my resolv.conf:

root@ubuntu:~# cat /etc/resolv.conf 
nameserver 127.0.0.1
domain localdomain
search localdomain

root@ubuntu:~# sv status /etc/service/*
run: /etc/service/dnscache: (pid 927) 22s; run: log: (pid 663) 517s
run: /etc/service/tinydns: (pid 898) 418s; run: log: (pid 660) 517s

root@ubuntu:~# cat /etc/service/dnscache/env/IP
127.0.0.1

root@ubuntu:~# dig @192.168.17.139 joe.com

; <<>> DiG 9.7.1-P2 <<>> @192.168.17.139 joe.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35794
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;joe.com.           IN  A

;; ANSWER SECTION:
joe.com.        300 IN  A   1.1.1.1

<snip>

Why would I get "WARNING: recursion requested but not available" when running dig. I believe it should be able to recurse using dnscache.

joe
  • 51
  • 1
  • 1
  • 4

1 Answers1

4

Which ports and IP addresses are the two servers bound to?

It looks like you might have tinydns (authoritative) on the 192.168.17.139 address, and dnscache (recursive) only on the loopback interface.

If so, you need to use dig @127.0.0.1 to talk to the recursive cache, or even just omit the IP address from the dig command line, at which point it'll default to using whatever's in /etc/resolv.conf

Alnitak
  • 21,191
  • 3
  • 52
  • 82
  • Correct, tinydns: 192.168.17.139, dnscache: 127.0.0.1. What you suggest works properly. I have another tinydns installation (not dbndns) that does not give me this warning. Seeing how dbndns/tinydns aren't recursive DNS servers shouldn't they always return "WARNING: recursion requested but not available"? – joe Oct 29 '10 at 14:51
  • Yup, a DNS server that's _only_ authoritative must send back an answer with the `RA` bit clear. Similarly the `RD` bit must be copied from the request to the response. If the server fails to copy the RD bit you won't see that warning. – Alnitak Oct 29 '10 at 16:09