/etc/resolve.conf

/etc/resolve.conf

我正在使用 BIND 9 建立循環 DNS nslookup stack.gearon.com

Server:         10.1.2.210
Address:        10.1.2.210#53

Name:   stack.gearon.com
Address: 10.1.2.213
Name:   stack.gearon.com
Address: 10.1.2.210
Name:   stack.gearon.com
Address: 10.1.2.212

但是,當我 ping 時stack.gearon.com,傳回的 IP 在該節點上始終相同。
讓我用一個例子來澄清這一點。假設我有 5 個節點 A stack.gearon.com、B、C、D 和 E。如果我stack.gearon.com從客戶端電腦 A 或 B 執行 ping 操作,傳回的 IP 是伺服器的 IP 之一,但也是固定的。

我的配置如下。

/etc/resolve.conf

# Generated by NetworkManager
nameserver 10.0.2.210

/etc/named.conf

options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        recursing-file  "/var/named/data/named.recursing";
        secroots-file   "/var/named/data/named.secroots";
        allow-query     { any; };

        /*
         - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
         - If you are building a RECURSIVE (caching) DNS server, you need to enable
           recursion.
         - If your recursive DNS server has a public IP address, you MUST enable access
           control to limit queries to your legitimate users. Failing to do so will
           cause your server to become part of large scale DNS amplification
           attacks. Implementing BCP38 within your network would greatly
           reduce such attack surface
        */
        recursion no;

        dnssec-enable yes;
        dnssec-validation yes;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";

        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};

zone "stack.com" IN {
  type master;
  file "stack.com.db";
  allow-update{none;};
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

/var/named/stack.com.db

$TTL 1D
@ IN SOA primary.gearon.com. root.stack.com.(
;2014112511 ;Serial
0 ;Serial
1D ;Refresh
1H ;Retry
1W ;Expire
3H ;Minimum TTL
)
;; 1st DNS
@ IN    NS      primary.gearon.com.
        A       10.1.2.210
;; Host List
primary         IN A 10.1.2.210
;; Enable round-robin here
stack           IN A 10.1.2.210
                IN A 10.1.2.212
                IN A 10.1.2.213

如果您需要更多詳細信息,請告訴我,並提前感謝您的幫助。歡迎任何評論。

答案1

對於遇到相同問題的任何人。我透過重新啟動網路ifdownifup刷新ARP表解決了這個問題。

相關內容