tinydns和dnscache服务正在运行,我的resolv.conf中有127.0.0.1:
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>
为什么我在运行dig时会收到“警告:请求递归但不可用”.我相信它应该能够使用dnscache进行递归.
解决方法
绑定的两个服务器是哪些端口和IP地址?
看起来你可能在192.168.17.139地址上有tinydns(权威),而在loopback接口上只有dnscache(递归).
如果是这样,你需要使用dig @ 127.0.0.1与递归缓存通信,或者甚至只是从dig命令行中省略IP地址,此时它将默认使用/etc/resolv.conf中的任何内容