NS1 后端

NS1 配置

  1. 使用此示例目标片段配置 NS1 后端

  targets:
    - type: ns1
      description: NS1 DNS Server

      # List out the designate-mdns servers from which NS1 servers should
      # request zone transfers (AXFRs) from.
      masters:
        - host: 192.0.2.1
          port: 5354

      # NS1 Configuration options
      options:
        #NS1 XFR container ip and port
        host: 192.0.2.2
        port: 5302
        #NS1 API enpoint IP address or name (Core container). Enter only base address or name.
        #Plugin will generate full api address, e.g. https://192.0.2.2/v1/zones/<zone name>
        api_endpoint: 192.0.2.2
        #NS1 API key
        api_token: changeme
        # If a tsigkey is needed, uncomment the line below and insert the key name, algorithm and value
        # NOTE: TSIG key has to be set manually
        #tsigkey_name: testkey
        #tsigkey_hash: hmac-sha512
        #tsigkey_value: 4EJz00m4ZWe005HjLiXRedJbSnCUx5Dt+4wVYsBweG5HKAV6cqSVJ/oem/6mLgDNFAlLP3Jg0npbg1SkP7RMDg==
  1. 然后更新 designate 中的池

$ designate-manage pool update

有关 designate-manage pool 命令的更多详细信息,请参阅 designate-manage pool,有关 yaml 文件语法的更多信息,请参阅 DNS 服务器池

TSIG 密钥配置

在某些情况下,部署者可能需要使用 tsig 密钥来签署 AXFR(区域传输)请求。由于 NS1 不支持每个主机的密钥设置,因此需要在创建时按区域设置。

为此,使用任何可用的工具(例如 tsig-keygen)生成 tsigkey

$ tsig-keygen -a hmac-sha512 testkey
key "testkey" {
    algorithm hmac-sha512;
    secret "vQbMI3u5QGUyRu6FWRm16eL0F0dfOOmVJjWKCTg4mIMNnba0g2PLrV+0G92WcTfJrgqZ20a4hv3RWDICKCcJhw==";
};

然后将其插入 Designate。确保池 ID 正确(如下面的 --resource-id)。

openstack tsigkey create --name testkey --algorithm hmac-sha512 --secret 4EJz00m4ZWe005HjLiXRedJbSnCUx5Dt+4wVYsBweG5HKAV6cqSVJ/oem/6mLgDNFAlLP3Jg0npbg1SkP7RMDg== --scope POOL --resource-id 794ccc2c-d751-44fe-b57f-8894c9f5c842

然后将其添加到 pools.yaml 文件中,如示例所示。