首页 > 学技术 > 技术网文 > DNS服务器 > 正文

[精华] DNS Cache 的一些小技巧汇总


来源 chinaunix.net 酷勤网整理

最近有不少关于DNS Cache 的帖子,让我学到了不少技巧。汇总一下。

Q: 如何查看 BIND DNS Server 的 Cache : 

A: 在 bind 9 中,可以使用 rndc -dumpdb 命令来查看 DNS Cache,当然你的 rndc 要先配置好。这个命令会在 /var/named (这个目录是在 named.conf 文件中指定的)目录中生成 named_dump.db 文件。 

在 bind 8 下,可以试试用 kill -INT named_pid 。

Q: DNS Cache 的时间如何设置:

A: 在 bind 9 中,使用 TTL 参数来设置 DNS 默认的缓存时间,但要记住这个是你解析的域名在别人的 DNS 中的缓存时间。

Q: 在客户端如何清空 DNS Cache:

A: 在 Unix 下,DNS 客户端只是几个例程,负责转发和接受查询的功能,并不缓存。

在 Windows 2000 & XP 下: ipconfig /flushdns can clear the cache; 
ipconfig /displaydns can display the dns cache.

windows 下的 dns cache 是由 dns client 后台进程控制的,你可以在控制面板 ->; 服务中将其关闭,这样 windows 就不会进行 dns 缓存,每次都将直接查询 dns server 。

Q: 在 DNS 服务器端如何清空 DNS Cache:

A: 最简单的方法就是重新启动 named 进程;当然也有不用重启的方法: rndc flush



 xbweifly 回复于:2003-06-19 16:41:09

谢谢,希望多提供这样的技巧


 forrestrun 回复于:2003-06-20 11:19:07

so good!!


 supereyes 回复于:2003-07-22 10:52:34

[root@mail /etc]# rndc dumpdb
rndc: connect failed: connection refused

这个是怎么回事?
我启动bind是用/etc/init.d/named start


 阿骁 回复于:2003-07-23 15:35:31

应该是 rndc 的配置有问题。你可以重新生成一个 rndc key ,然后再试看看。


 rayharris 回复于:2003-07-24 09:35:11

2000下的ipconfig /displaydns技巧很不错,挺实用的,谢谢!


 Lanchou 回复于:2004-05-13 11:07:03

have configed the rndc ,usr rndc status to show:

root@dns02:/usr/local/bind-jail/sbin>;./rndc status
number of zones: 14
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is ON
server is up and running

root@dns02:/usr/local/bind-jail/sbin>;./rndc dumpdb 
but show noting.

Question:
1. How can i know dns cache function is enble?
2.  how can I enble or diable dns cache function ?


 sunnycn 回复于:2004-12-27 21:18:23

引用:原帖由 "阿骁" 发表:
最近有不少关于DNS Cache 的帖子,让我学到了不少技巧。汇总一下。

Q: 如何查看 BIND DNS Server 的 Cache : 

A: 在 bind 9 中,可以使用 rndc -dumpdb 命令来查看 DNS Cache,当然你的 rndc 要先配置好。这个..........



版主的这个写的很漂亮。
如果版主在有时间的时候,能不能再完善一些。
谢谢!


 sunnycn 回复于:2004-12-29 22:38:19

在bind 9中配置rndc  还是要好好的看看相关的文档的了。
在“精华区里面”有这样的帖子。
但是,按照上面的步骤配置的时候有些问题。


 littleice 回复于:2004-12-30 08:57:32

这个贴精吧,我们也好找。


 liuzhy 回复于:2005-01-06 11:17:20

引用:原帖由 "Lanchou" 发表:
have configed the rndc ,usr rndc status to show:

root@dns02:/usr/local/bind-jail/sbin>;./rndc status
number of zones: 14
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in prog..........




1. you did not try to reslove any dns entry, so cache is empty.
2. Generally, any dns server is a dns cache server. I do not know how to disable it.


 liuzhy 回复于:2005-01-06 11:18:02

引用:原帖由 "Lanchou" 发表:
have configed the rndc ,usr rndc status to show:

root@dns02:/usr/local/bind-jail/sbin>;./rndc status
number of zones: 14
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in prog..........




1. you did not try to reslove any dns entry, so cache is empty.
2. Generally, any dns server is a dns cache server. I do not know how to disable it.


 bitterness 回复于:2006-12-13 13:17:45

我可是在偷偷学知识呢,感觉自己人要学的太多了,心烦呀


 Momoass 回复于:2006-12-13 19:16:48

只想做cache服务器的话用pdnsd比较好。


 HawaiiLeo 回复于:2007-03-23 15:07:20

楼住的帖子每一个都让人受益匪浅,努力中。。。




原文链接:http://bbs.chinaunix.net/viewthread.php?tid=95684
转载请注明作者名及原文出处



收藏本页到: