DJBDNS DNSCache 配置,svscan 无法启动

DJBDNS DNSCache 配置,svscan 无法启动

过去几天,我一直在绞尽脑汁尝试在我的服务器上设置 DJBDNS。但运气不佳。我一直在遵循 DJBDNS 创建者提供的指南:http://cr.yp.to/djbdns/run-server.html

以下是我所在位置的概述:

两个服务均已启动:

[root@Happycat tinydns]$ svstat /service/tinydns/
/service/tinydns/: up (pid 18224) 74454 seconds
[root@Happycat tinydns]$ svstat /service/dnscache/
/service/dnscache/: up (pid 2733) 2184 seconds

我的/etc/resolv.conf文件:

nameserver 127.0.0.1

我的$PATH

[root@Happycat ~]$ echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/sbin:/usr/sbin:/var/qmail/bin/:/usr/nexkit/bin:/root/bin

我的tinydns/root/data记录:

..:69.160.56.65:a:259200
.ns1.benwilk.com:69.160.56.65:a:259200
.ns2.benwilk.com:69.160.56.65:a:259200
.56.160.69.in-addr.arpa:69.160.56.65:a:259200
.56.160.69.in-addr.arpa:69.160.56.65:b:259200
=benwilk.com:69.160.56.65:86400
=openbarrel.net:69.160.56.65:86400
+www.openbarrel.net:69.160.56.65:86400
+www.benwilk.com:69.160.56.65:86400

Tiny dns可以识别的记录集:

[root@Happycat root]$ tinydns-get a benwilk.com
1 benwilk.com:
78 bytes, 1+1+1+1 records, response, authoritative, noerror
query: 1 benwilk.com
answer: benwilk.com 86400 A 69.160.56.65
authority: . 259200 NS a.ns
additional: a.ns 259200 A 69.160.56.65

但随后一切都戛然而止:

svscan /service/tinydns/
supervise: fatal: unable to start env/run: file does not exist
supervise: fatal: unable to acquire log/supervise/lock: temporary failure
supervise: fatal: unable to start supervise/run: file does not exist
supervise: fatal: unable to start root/run: file does not exist
supervise: fatal: unable to start env/run: file does not exist
supervise: fatal: unable to start supervise/run: file does not exist
supervise: fatal: unable to start root/run: file does not exist
supervise: fatal: unable to start env/run: file does not exist
supervise: fatal: unable to start supervise/run: file does not exist
supervise: fatal: unable to start root/run: file does not exist
supervise: fatal: unable to start env/run: file does not exist
supervise: fatal: unable to start supervise/run: file does not exist
supervise: fatal: unable to start root/run: file does not exist
supervise: fatal: unable to start env/run: file does not exist
supervise: fatal: unable to start supervise/run: file does not exist
supervise: fatal: unable to start root/run: file does not exist
supervise: fatal: unable to acquire log/supervise/lock: temporary failure
supervise: fatal: unable to start env/run: file does not exist
supervise: fatal: unable to start supervise/run: file does not exist
supervise: fatal: unable to start root/run: file does not exist

我假设我必须使用 DNScache 设置一些东西,老实说,这有点令人困惑。我不确定是否要将其 IP 地址设置为 127.0.0.1 或系统上的其他 IP 地址之一。我在这里遗漏了什么?

答案1

TinyDNS 和 DNScache 完全独立。请确保您没有尝试将它们绑定到同一个地址,因为它们都需要 UDP 端口 53。

通常,您会在 127.0.0.1:53 上运行 dnscache,在 public:53 上运行 tinydns。请在两个服务的各自 env/IP 文件中验证这一点。

以下是解决服务无法启动的故障的程序。假设您从 tinydns 开始。

  1. 删除 tinydns:

    svc -d /service/tinydns
    
  2. 检查没有其他 tinydns 实例正在运行:

    ps ax | grep tinydns ; killall tinydns
    
  3. 进入服务目录,交互运行服务:

    cd /service/tinydns
    ./run
    

如果可行,请在 daemontools 级别进行解决。从启动脚本中删除它们并手动运行它们:

svscan /service

如果此方法有效,则问题出在您用于启动 daemontools 本身的脚本中。在 Linux 上,通常是/etc/inittab/etc/init/svscan.conf。在 FreeBSD 上/usr/local/etc/rc.d/svscan

相关内容