V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
mrco
V2EX  ›  问与答

利用 powerdns 自建权威 DNS 和递归 DNS 遇到的问题,求助!..

  •  
  •   mrco · 2017-04-17 20:06:10 +08:00 · 5478 次点击
    这是一个创建于 2589 天前的主题,其中的信息可能已经有所发展或是发生改变。
    • 利用 powerdns+mysql 做了权威 DNS 服务器;
      • 权威(内部)DNS 的查询是没有问题的;
      • 递归查询不定时歇菜,最早递归查询外网的域名是在 pdns.conf 里指定 recursor=223.5.5.5 的,后来为了解决这个问题,也看了官网的建议,所以在本机另外安装了 pdns-recursor,并监听本机的 5300 端口;
      • 这样我修改 pdns.conf 里的 recursor=127.0.0.1:5300, 好了 2 天,但是今天下午又出现之前一样的问题,表象就是只能权威查询,不能递归查询外网的域名,无奈只能重启 pdns..
      • 对外服务的是 10.28.70.100 这个虚拟 IP.

    配置和报错:

    pdns.conf

    launch=gmysql
    gmysql-host=127.0.0.1
    gmysql-user=*********
    gmysql-dbname=pdns
    gmysql-password=*******
    webserver=yes
    webserver-address=127.0.0.1
    webserver-allow-from=127.0.0.1
    webserver-port=8081
    api=yes
    api-key=********
    api-logfile=/var/log/pdns-api.log
    config-dir=/etc/pdns
    include-dir=/etc/pdns/pdns.d
    guardian=yes
    local-address=0.0.0.0
    security-poll-suffix=
    setgid=pdns
    setuid=pdns
    default-soa-name=ns1.***.com
    default-soa-edit=INCEPTION-INCREMENT
    default-soa-mail=hostmaster.***.com
    default-ttl=600
    daemon=yes
    disable-axfr=no
    distributor-threads=10
    max-cache-entries=1000000
    max-queue-length=5000
    max-tcp-connections=10000
    recursor=127.0.0.1:5300
    allow-recursion=10.28.0.0/16
    retrieval-threads=10
    reuseport=yes
    server-id=ns1.***.com
    

    recursor.conf

    setuid=pdns-recursor
    setgid=pdns-recursor
    forward-zones=.=223.5.5.5;114.114.114.114
    local-address=0.0.0.0
    local-port=5300
    

    报错:

    Apr 17 19:20:01 base3 pdns_server: Apr 17 19:20:01 Recursive query for remote 10.28.70.100:16733 with internal id 2 was not answered by backend within timeout, reusing id
    Apr 17 19:20:04 base3 pdns_server: Apr 17 19:20:04 Recursive query for remote 10.28.80.11:49570 with internal id 3 was not answered by backend within timeout, reusing id
    Apr 17 19:20:04 base3 pdns_server: Apr 17 19:20:04 Recursive query for remote 10.28.70.100:59774 with internal id 15 was not answered by backend within timeout, reusing id
    Apr 17 19:20:06 base3 pdns_server: Apr 17 19:20:06 Recursive query for remote 10.28.43.11:27463 with internal id 4 was not answered by backend within timeout, reusing id
    
    4 条回复    2017-04-18 08:27:40 +08:00
    AstroProfundis
        1
    AstroProfundis  
       2017-04-17 20:44:34 +08:00
    直接往本机 5300 查询有结果吗
    mrco
        2
    mrco  
    OP
       2017-04-17 20:45:56 +08:00
    @AstroProfundis 可以的,也就是说 backend 的功能是正常的,但是 pdns 在将受到的递归查询转发到后端这期间,timeout 了,,,,
    itsjoke
        3
    itsjoke  
       2017-04-17 21:22:38 +08:00 via iPhone
    递归会受到国际网络因素影响
    mrco
        4
    mrco  
    OP
       2017-04-18 08:27:40 +08:00
    @itsjoke 我指定的 223.5.5.5 和 114.114.114.114 啊,这应该是国内最快的 DNS 了吧..
    网卡上指定这 2 个 DNS 都一点问题都没有,只是通过 pdns 指定后端递归 DNS 服务器的时候 就会时不时出现上面的报错了,然后递归就不能用了.

    我认为是 pdns 自己的问题.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5210 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 06:03 · PVG 14:03 · LAX 23:03 · JFK 02:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.