安装pdnsd缓冲dns

上网、浏览、聊天、下载等
回复
tk4479
帖子: 15
注册时间: 2009-03-05 14:46
送出感谢: 0
接收感谢: 0

安装pdnsd缓冲dns

#1

帖子 tk4479 » 2009-04-09 12:35

安装sudo apt-get install pdnsd

安装完以后自动进入配置界面,选择manual手工配置,退出配置界面

修改pdnsd
sudo gedit /etc/default/pdnsd
START_DAEMON=no改成START_DAEMON=yes,这个选项允许pdnsd后台运行

修改pdnsd.conf
sudo gedit /etc/pdnsd.conf
perm_cache=10240;
我设置的10240,表示pdnsd用10m空间来缓存dns数据
min_ttl=3d;
这个表示最少缓存3天可以改 1w表示1周 1s表示1秒 1m表示1分钟 1h1小时
将第一个
server {
xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx
}
改成
server {
label="i.root.servers.net";
ip=192.36.148.17;
}
其中label可以自己设置,也可以不要,
ip就是pdnsd使用的dns,可以自己改isp提供的dns
我用的是dns根服务器地址,可以自己ping x.root-servers.net
x从a到m,选一个响应速度最快的

sudo gedit /etc/resolv.conf
nameserver 全部删除只留一个设置成127.0.0.1

配置完了重启,pdnsd就自动运行了,以后dns请求会优先到缓存里面找
tk4479
帖子: 15
注册时间: 2009-03-05 14:46
送出感谢: 0
接收感谢: 0

Re: 安装pdnsd缓冲dns

#2

帖子 tk4479 » 2009-04-09 12:39

pdnsd运行以后可以用pdnsd-ctl来查看运行状态

sudo pdnsd-ctl status

例如我的运行状态如下
Cache status:
=============
10240 kB maximum disk cache size.
730235 of 10496000 bytes (6.96%) memory cache used in 1591 entries.

Thread status:
==============
pdnsd control thread is running.
tcp server thread is running.
udp server thread is running.
751 query threads spawned in total (0 queries dropped).
0 running query threads (0 active, 0 queued).

Configuration:
==============
Global:
-------
Cache size: 10240 kB
Server directory: /var/cache/pdnsd
Scheme file (for Linux pcmcia support): /var/lib/pcmcia/scheme
Server port: 53
Server ip (0.0.0.0=any available one): 127.0.0.1
Ignore cache when link is down: off
Maximum ttl: 604800
Minimum ttl: 259200
Negative ttl: 900
Negative RRS policy: auth
Negative domain policy: auth
Run as: pdnsd
Strict run as: on
Use NSS: on
Paranoid mode (cache pollution prevention): on
Control socket permissions (mode): 600
Maximum parallel queries served: 40
Maximum queries queued for serving: 60
Global timeout setting: 10
Parallel queries increment: 2
Randomize records in answer: on
Query method: udp_only
Query port start: 1024
Query port end: 65535
TCP server thread: on
TCP query timeout: 30
Delegation-only zones: (none)
Server 0:
------
label: i.root.servers.net
ip: 192.36.148.17
server assumed available: yes
port: 53
uptest: none
timeout: 120
uptest interval: 900
ping timeout: 600
ping ip: (using server ip)
interface:
device (for special Linux ppp device support):
uptest command:
uptest user: (process owner)
force cache purging: off
server is cached: on
lean query: on
Use only proxy?: off
Assumed root server: no
Randomize server query order: no
Default policy: included
Policies: (none)
Succeeded
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
送出感谢: 0
接收感谢: 7 次
联系:

Re: 安装pdnsd缓冲dns

#3

帖子 BigSnake.NET » 2009-04-09 13:13

跟 dnsmasq 的有什么区别
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
wenjianhn
帖子: 583
注册时间: 2008-10-15 10:49
来自: CS
送出感谢: 0
接收感谢: 0

Re: 安装pdnsd缓冲dns

#4

帖子 wenjianhn » 2009-04-14 14:15

Mark

代码: 全选

 _____________
< 呜呜buntu >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
回复

回到 “因特网相关软件”