AWS 上的主从 DNS Ubuntu 配置

AWS 上的主从 DNS Ubuntu 配置

我有以下架构。

域名 example.com 在外部提供商处注册。

AWS 内有 2 个 DNS 服务器:

DNS 服务器 1(主服务器):

公共 IP:100.200.300.400 | 公共 DNS:100-200-300-400.aws.com | 私有 IP:1.2.3.4

DNS 服务器 2(从属):

公有 IP:101.202.303.404 | 公有 DNS:101-202-303-404.aws.com | 私有 IP:5.6.7.8

命名的.conf.本地

掌握:

zone "example.com" {
        type master;
        file "/etc/bind/db.example.com";
        notify yes;
        allow-transfer { 5.6.7.8; };
};

奴隶:

zone "example.com" {
        type slave;
        file "/etc/bind/db.example.com";
        notify yes;
        allow-transfer { 1.2.3.4; };
};

db.example.com

$TTL    86400
@       IN      SOA     localhost root.localhost. (
                        1               ; Serial
                        15M             ; Refresh
                        15M             ; Retry
                        15M             ; Expire
                        15M )           ; Negative Cache TTL
;
example.com.     IN      A       SOME-IP

我的问题是:这个配置可以吗?

我特别想知道:

*我应该使用私有 IP 还是公共 IP 来进行主从通信

*是 localhost root.localhost。db.example.com恰当的?

答案1

我在 AWS 中使用 Ubuntu 配置了主从 DNS 服务器。为这两个实例配置公共 IP(弹性 IP)。将 FQDN 放在解析到弹性 IP 的每个服务器上。使用 fqdn 代替 localhost。我遵循 Ubuntu HOWTO 进行此实现。

在从属服务器中使用“also-notify”语句。在所有配置文件中将 localhost 更改为 FQDN。其余语法似乎没问题。

在配置 DNS 之前,请确保每台服务器都能解析自己的公网 IP,并能解析其他服务器对应的 IP。

相关内容