【问题标题】:DNS bind9 : can't see cacheDNS bind9:看不到缓存
【发布时间】:2015-04-02 14:29:59
【问题描述】:

我正在使用带有两个不同虚拟机的种子 Ubuntu 12.04:第一个用于运行 BIND9 的 DNS 服务器,第二个用于模拟用户/客户端。我的任务是毒化 DNS 服务器缓存。

在用户机器中,我将主 DNS 地址配置为 DNS 服务器机器的地址。

嗯,这是named.conf.options 文件的上下文(位置是/etc/bind/):

options {
    directory "/var/cache/bind";
    // If there is a firewall between you and nameservers you want
    // to talk to, you may need to fix the firewall to allow multiple
    // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

    // If your ISP provided one or more IP addresses for stable 
    // nameservers, you probably want to use them as forwarders.  
    // Uncomment the following block, and insert the addresses replacing 
    // the all-0's placeholder.

    // forwarders {
    //  0.0.0.0;
    // };

    //========================================================================
    // If BIND logs error messages about the root key being expired,
    // you will need to update your keys.  See https://www.isc.org/bind-keys
    //========================================================================
    //dnssec-validation auto;
    dnssec-enable no;

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };
    dump-file   "/var/cache/bind/dump.db";
    query-source port 33333;
};

在用户中,我尝试使用不同的主机名(google.com、cnn.com 等)输入一些不同的地址,以查看对缓存文件的影响。

问题:无论我做什么,缓存文件都是空的。当然我使用转储命令:

sudo rndc dumpdb -cache

但文件/var/cache/bind/dump.db 仍然是空的。 谢谢!

【问题讨论】:

    标签: caching dns bind


    【解决方案1】:

    我假设您的 Ubuntu 安装的 bind 默认使用 chroot。该文件将相对于运行/配置绑定的 chroot 环境的根目录创建。

    例如,在 Redhat 风格的发行版中,/var/named/chroot/etc/named.conf 只会引用 dump-file "/var/named/data/cache_dump.db";;但是,它的完整路径是/var/named/chroot/var/named/data/cache_dump.db。

    此外,无论 chroot 环境如何,您都可以使用诸如 locate(1) 或 find(1) 之类的工具来定位文件。

    【讨论】:

      猜你喜欢
      • 2010-12-22
      • 2022-01-05
      • 1970-01-01
      • 2021-05-06
      • 2012-07-30
      • 1970-01-01
      • 2016-12-16
      • 2021-05-09
      • 2014-07-13
      相关资源
      最近更新 更多