服务器使用 pdnsd 部署 DNS forwarder 的方法

Assume that you use Ubuntu.

Download & Install pdnsd:

At the setup configuration step, choose manual. Then modify the config file: /etc/pdnsd.conf

At the global section, change server_ip, add server_port, increase or decrease the perm_cache, change min_ttl & max_ttl at your own need, just like:

Then add the upstream DNS server, just like:

Comment out the unnecessary sections, such as root-servers & resolvconf:

Here’s an example for pdnsd.conf

To see more details of pdnsd, just look at pdnsd Documents

Modify the file /etc/default/pdnsd, change START_DAEMON=no to START_DAEMON=yes and save the file. Finally start pdnsd:

Add firewall rule if neccessary (Assume that you use UFW):
Check it on your PC:

88 条评论

  1. tom 回复

    请问一下,vps上的pdnsd是以转发还是以代理的方式工作的? 我的需求是 “要让目标服务器 认为 vps (pdnsd装在上面,接受来自于国内的dns查询)是请求的发起人,目标服务器登记的是国外vps的ip而不是登记的国内dns client所在的国内ip。

  2. dover 回复

    [….] Starting pdnsdError in config file (line 36): invalid option for server section: edns_query
    failed!

    请问,edns_query这参数没有了么?

    1. cokebar 文章作者 回复

      pdnsd版本多少?

      1. dover 回复

        pdnsd-1.2.8-par

    2. cokebar 文章作者 回复

      更新到1.2.9,最后一版。

  3. 引用: 服务器使用 pdnsd 部署 DNS forwarder 的方法 – 飞羽博客 – 龙的小站

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

请输入验证码 *