DNS Cache 的一些小技巧汇总

王朝厨房·作者佚名  2007-01-02
窄屏简体版  字體: |||超大  

最近有不少关于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

[quote:313379be87="阿骁"]最近有不少关于DNS Cache 的帖子,让我学到了不少技巧。汇总一下。

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

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

版主的这个写的很漂亮。

如果版主在有时间的时候,能不能再完善一些。

谢谢!

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

在bind 9中配置rndc 还是要好好的看看相关的文档的了。

在“精华区里面”有这样的帖子。

但是,按照上面的步骤配置的时候有些问题。

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

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

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

[quote:1803933dc9="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..........[/quote:1803933dc9]

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

[quote:e3674dcddc="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..........[/quote:e3674dcddc]

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.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航