利用 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:

PS:经读者反馈,dnsmasq貌似不支持压缩指针变异,使用chinadns如果启动时候加了-m的话,会造成无法解析。有此情况的读者还请换用pdnsd

83 条评论

  1. tom 回复

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

发表评论

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

请输入验证码 * Time limit is exhausted. Please reload CAPTCHA.