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.
Which ports and IP addresses are the two servers bound to?
It looks like you might have
tinydns
(authoritative) on the192.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 thedig
command line, at which point it'll default to using whatever's in/etc/resolv.conf