AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[rndc](server)

Martin Hope
MrTaik
Asked: 2021-02-13 12:18:12 +0800 CST

BIND9 仅使用also-notify 向从站发送通知

  • -2

我有一个问题已经让我发疯了三天!我正在用新的权威 DNS 服务器替换我的权威 DNS 服务器,然后我再次重置所有 BIND9 配置,以便在替换的情况下进行更多“微调”。

我已经配置了一个 MASTER 服务器和两个 SLAVE 服务器,我已经配置了一个区域用作测试,而我通常用于测试的域 (FQDN),问题是这样的:

  • 当我更新区域并重新启动/重新加载绑定时,从日志中我看到通知已正确发送,但所有从属设备都没有收到(也使用 tcpdump 端口 53 验证:没有从主设备输出)

Feb 12 20:42:13 svr-3 named[12957]: zone test.com/IN: sending notifies (serial 20210 21201)

  • 如果我改为添加指令“also-notify {slave_ip_1; slave_ip_2;}; 通知被正确发送和接收(使用 tcpdump 端口 53 和绑定日志验证),显然传输过程正确开始和结束

在这一点上,我认为是我的 MASTER 的某些配置有问题,我已经转义或设置不正确,因为从机接收正确;看起来好像它没有读取权威的 NS 记录。

我正在附上配置文件,或许有你的帮助,我可以找到错误(文件要补全,遇到这个问题我就停了)

命名.conf.options

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;

        listen-on { xxx; };
        listen-on-v6 { any; };

        //IP da utilizzare per le richieste in uscita di aggiornamento zone e il forward dei dynamic updates
        transfer-source xxx;

        //Abilito le notifiche
        notify yes;

        //Quale IP utilizzare per le notifiche in uscita
        notify-source xxx;

        //IP da notificare in aggiunta degli NS RR
//      also-notify { yyy; zzz;  };

        auth-nxdomain no;

        // hide version number from clients for security reasons.
        version "Not Available";

        // disable recursion on authoritative DNS server.
        recursion no;

        // enable the query log
        querylog yes;

        // disallow zone transfer
        allow-transfer { none; };

};

区域文件

; BIND reverse data file for empty rfc1918 zone
;
; DO NOT EDIT THIS FILE - it is used for multiple zones.
; Instead, copy it, edit named.conf, and use that copy.
;

$TTL    86400           ;TTL (1 Giorno)
$ORIGIN test.com.    ;Base Dominio

; Record Start of Authority (SOA)
@       IN      SOA     ns1.test.net. hostmaster.test.net. (
                       2021021201       ; Serial
                          21600         ; Refresh (6H)
                          10800         ; Retry (3H)
                         604800         ; Expire (1 Settimana)
                         604800 )       ; Negative Cache TTL (1 Settimana)
; Record A
@       10800   IN      A       123.345.678.123
www     10800   IN      A       123.345.678.123

; Record AAAA

; Record CNAME

; Record TXT

; Record SRV

; Record MX
@       3600    IN      MX      1       mail.test.net.
@       3600    IN      MX      10      mail2.test.net.

; Record NS
@       IN      NS      ns1.test.net.
@       IN      NS      ns2.test.net.
@       IN      NS      dns.otherdomain.it.

命名.conf.local

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "test.com" {
      type master;
      file "/etc/bind/zones/db.test.com";
      allow-query { any; };
      allow-transfer { key keytest; };
};
domain-name-system bind dns-zone rndc
  • 1 个回答
  • 562 Views
Martin Hope
Dunner1991
Asked: 2020-09-25 05:37:11 +0800 CST

rndc 命令不起作用

  • 1

我一直在 centos 7 上构建 DNS 服务器(我继承了这些但需要进行更改以重新利用它们)

当我运行任何 rndc 命令时它不起作用,即当我尝试 rndc reload 时,如果成功,我没有得到确认,甚至没有得到命令失败

另请注意,我使用的是 linux 命名空间,因此典型的 rndc 命令具有前缀“ip entns exec gi”

如果我同时检查 /var/log/messages,与另一台 DNS 服务器相比,我不会得到任何输出。

我在下面发布了必要服务的输出:

/usr/lib/systemd/system/named.service

[Unit]
Description=Berkeley Internet Name Domain (DNS)
Wants=nss-lookup.target
Wants=named-setup-rndc.service
Before=nss-lookup.target
After=network.target
After=named-setup-rndc.service

[Service]
Type=forking
Environment=NAMEDCONF=/etc/named.conf
EnvironmentFile=-/etc/sysconfig/named
Environment=KRB5_KTNAME=/etc/named.keytab
PIDFile=/run/named/named.pid

ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi'

ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} $OPTIONS

ExecReload=/bin/sh -c '/usr/sbin/rndc reload > /dev/null 2>&1 || /bin/kill -HUP $MAINPID'

ExecStop=/bin/sh -c '/usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID'

PrivateTmp=true

[Install]
WantedBy=multi-user.target

/usr/lib/systemd/system/named-setup-rndc.service

[Unit]
Description=Generate rndc key for BIND (DNS)

[Service]
Type=oneshot

ExecStart=/usr/libexec/generate-rndc-key.sh

我试图删除 rndc.key 文件并使用命名服务重新创建,但这没有奏效。我真的很难过。有人对此有经验吗

命名后重新启动日志

-- Unit named-setup-rndc.service has begun starting up.
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 systemd[1]: Started Generate rndc key for BIND (DNS).
-- Subject: Unit named-setup-rndc.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit named-setup-rndc.service has finished starting up.
-- 
-- The start-up result is done.
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 systemd[1]: Starting Berkeley Internet Name Domain (DNS)...
-- Subject: Unit named.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit named.service has begun starting up.
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: starting BIND 9.9.4-RedHat-9.9.4-74.el7_6.1 -u named -c /etc/named.conf -4
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: built with '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '-
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: ----------------------------------------------------
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: BIND 9 is maintained by Internet Systems Consortium,
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: Inc. (ISC), a non-profit 501(c)(3) public-benefit
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: corporation.  Support and training for BIND 9 are
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: available at https://www.isc.org/support
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: ----------------------------------------------------
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: adjusted limit on open files from 4096 to 1048576
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: found 8 CPUs, using 8 worker threads
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: using 8 UDP listeners per interface
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: using up to 21000 sockets
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: loading configuration from '/etc/named.conf'
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: reading built-in trusted keys from file '/etc/named.root.key'
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: initializing GeoIP Country (IPv4) (type 1) DB
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: GEO-106FREE 20180327 Build 1 Copyright (c) 2018 MaxMind Inc All Rights Reserved
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: initializing GeoIP Country (IPv6) (type 12) DB
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: GEO-106FREE 20180605 Build 1 Copyright (c) 2018 MaxMind Inc All Rights Reserved
Sep 24 14:01:40 DUB1-00-VM-GI_DNS1 named[12637]: GeoIP City (IPv4) (type 2) DB not available

我也相信调试日志被设置为写入 /var/named/data/named.run 下面发布的输出

tail -f /var/named/data/named.run
all zones loaded
running
shutting down
stopping command channel on 127.0.0.1#953
stopping command channel on ::1#953
no longer listening on 127.0.0.1#53
exiting
managed-keys-zone: loaded serial 1021
all zones loaded
running
domain-name-system bind rndc
  • 1 个回答
  • 1045 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve