解析程序委托规则教程 - Amazon Route 53

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

解析程序委托规则教程

委托规则允许 Route 53 Resolver 通过指定的出站端点访问托管委托区域的名称服务器。虽然转发规则通知 Route 53 Resolver 通过出站端点将 DNS 查询转发到与指定域匹配的名称服务器,但委托规则通知 Route 53 Resolver 通过返回委托的 NS 记录时指定的出站端点访问委托的名称服务器。当 DNS 响应中的 NS 记录与委托记录中指定的域名匹配时,Route 53 Resolver 会向委托的名称服务器发送查询。

使用 Resolver 端点出站委托的步骤

  1. 在您希望 DNS 查询从其中发起并发送到网络上的解析程序的 VPC 中,创建一个 Route 53 Resolver 出站端点。

    您可以使用以下 API 或 CLI 命令:

  2. 创建一个或多个委托规则,这些规则指定应通过指定的出站端点将查询委托到您的网络的域名。

    使用 CLI 创建委托规则的示例:

    aws route53resolver create-resolver-rule \ --region REGION \ --creator-request-id delegateruletest \ --delegation-record example.com \ --name delegateruletest \ --rule-type DELEGATE \ --resolver-endpoint-id outbound endpoint ID
  3. 将委托规则与您想要委托查询的委托规则相关联。 VPCs

    您可以使用以下 API 或 CLI 命令:

Resolver 出站端点支持的委托类型

Route 53 Resolver 支持两种类型的出站委托:

  • Route 53 私有托管区到 Route 53 Resolver 出站委托:

    使用出站委托,将私有托管区中的子域委托给本地 DNS 服务器或 Internet 上的公有托管区。此出站委托允许您在私有托管区和委托区域之间分配 DNS 记录的管理。根据您的 DNS 设置,可以在私有托管区中使用或不使用粘附记录进行委托。有关更多信息,请参阅 私有托管区到出站

  • Route 53 Resolver 出站到出站委托:

    使用出站到出站委托,将子域从您的本地 DNS 服务器委托给位于相同或不同位置的另一个本地服务器。这类似于从私有托管区委托给出站端点,您可以在其中委托给本地名称服务器上托管的区域。有关更多信息,请参阅 出站到出站

Route 53 私有托管区到 Route 53 Resolver 出站委托配置示例

假设有一个 DNS 设置,其中父托管区托管在 Amazon VPC 的 Route 53 私有托管区中,子域委托给在欧洲、亚洲和北美洲托管的名称服务器。所有 DNS 查询都将通过 Route 53 Resolver 传递。

按照示例步骤配置您的私有托管区和 Route 53 Resolver。

配置出站委托的私有托管区
  1. 对于私有托管区设置:

    父托管区:hr.example.com

    $TTL 86400 ; 24 hours $ORIGIN hr.example.com @ 1D IN SOA @ root (20200322001 3H 15 1w 3h) @ 1D IN NS @ eu.hr.example.com IN NS ns1.eu.hr.example.com. apac.hr.example.com IN NS ns2.apac.hr.example.com. na.hr.example.com IN NS ns3.na.hr.example.net. # Out of Zone Delegation ns1.eu.hr.example.com IN A 10.0.0.30 # Glue Record ns2.apac.hr.example.com IN A 10.0.0.40 # Glue Record
  2. 对于欧洲本地区域中的本地名称服务器:

    • 托管区:eu.hr.example.com NS IP:10.0.0.30

    $TTL 86400 ; 24 hours $ORIGIN eu.hr.example.com @ 1D IN SOA @ root (20200322001 3H 15 1w 3h) @ 1D IN NS @ test.eu.hr.example.com IN A 1.2.3.4
  3. 对于亚洲本地区域中的本地名称服务器:

    托管区:apac.hr.example.com10.0.0.40

    APAC 名称服务器可以将子域委托给其他名称服务器。

    $TTL 86400 ; 24 hours $ORIGIN apac.hr.example.com @ 1D IN SOA @ root (20200322001 3H 15 1w 3h) @ 1D IN NS @ test.apac.hr.example.com IN A 5.6.7.8 engineering.apac.hr.example.com IN NS ns1.engineering.apac.hr.example.com sales.apac.hr.example.com IN NS ns2.sales.apac.hr.example.com ns1.engineering.apac.hr.example.com IN A 10.0.0.80 ns2.sales.apac.hr.example.com IN A 10.0.0.90

    托管区:engineering.apac.hr.example.com10.0.0.80

    $TTL 86400 ; 24 hours $ORIGIN engineering.apac.hr.example.com @ 1D IN SOA @ root (20200322001 3H 15 1w 3h) @ 1D IN NS @ test.engineering.apac.hr.example.com IN A 1.1.1.1
  4. 对于北美洲本地区域中的本地名称服务器:

    托管区:na.hr.example.net NS IP:10.0.0.50

    $TTL 86400 ; 24 hours $ORIGIN na.hr.example.net @ 1D IN SOA @ root (20200322001 3H 15 1w 3h) @ 1D IN NS @ ns3.na.hr.example.net. IN A 10.0.0.50 test.na.hr.example.com IN A 9.10.11.12
Route 53 Resolver 设置
  • 对于 Route 53 Resolver,您需要设置一条转发规则和两条委托规则:

    转发规则

    1. 用于转发 out-of-zone委派记录,因此 Route 53 解析器知道要转发初始请求的委托的 NS 的 IP。

      domain-name:hr.example.net target-ips:10.0.0.50

    委托规则

    1. 区域内委托的委托规则:

      委托记录:hr.example.com

    2. 区域外委托的委托规则:

      委托记录:hr.example.net

出站到出站委托示例配置

不是将父托管区置于 Amazon VPC 中,而是假设有一个 DNS 设置,其中父托管区位于本地中心位置,而子域被委托给在欧洲、亚洲和北美洲托管的名称服务器。所有 DNS 查询都将通过 Route 53 Resolver 传递。

按照示例步骤配置本地 DNS 和 Route 53 Resolver。

配置本地 DNS
  1. 对于本地中心区域中的本地名称服务器:

    • 父托管区:hr.example.com

      托管区 hr.example.com,NS IP:10.0.0.20

    $TTL 86400 ; 24 hours $ORIGIN hr.example.com @ 1D IN SOA @ root (20200322001 3H 15 1w 3h) @ 1D IN NS @ eu.hr.example.com IN NS ns1.eu.hr.example.com. apac.hr.example.com IN NS ns2.apac.hr.example.com. na.hr.example.com IN NS ns3.na.hr.example.net. # Out of zone delegation ns1.eu.hr.example.com IN A 10.0.0.30 # Glue record ns2.apac.hr.example.com IN A 10.0.0.40 # Glue record
  2. 对于欧洲本地区域中的本地名称服务器(欧洲、亚洲和北美洲名称服务器的配置与私有托管区的出站委托配置相同):

    • 托管区:eu.hr.example.com NS IP:10.0.0.30

    $TTL 86400 ; 24 hours $ORIGIN eu.hr.example.com @ 1D IN SOA @ root (20200322001 3H 15 1w 3h) @ 1D IN NS @ test.eu.hr.example.com IN A 1.2.3.4
  3. 对于亚洲本地区域中的本地名称服务器:

    托管区:apac.hr.example.com10.0.0.40

    APAC 名称服务器可以将子域委托给其他名称服务器。

    $TTL 86400 ; 24 hours $ORIGIN apac.hr.example.com @ 1D IN SOA @ root (20200322001 3H 15 1w 3h) @ 1D IN NS @ test.apac.hr.example.com IN A 5.6.7.8 engineering.apac.hr.example.com IN NS ns1.engineering.apac.hr.example.com sales.apac.hr.example.com IN NS ns2.sales.apac.hr.example.com ns1.engineering.apac.hr.example.com IN A 10.0.0.80 ns2.sales.apac.hr.example.com IN A 10.0.0.90

    托管区:engineering.apac.hr.example.com10.0.0.80

    $TTL 86400 ; 24 hours $ORIGIN engineering.apac.hr.example.com @ 1D IN SOA @ root (20200322001 3H 15 1w 3h) @ 1D IN NS @ test.engineering.apac.hr.example.com IN A 1.1.1.1
  4. 对于北美洲本地区域中的本地名称服务器:

    托管区:na.hr.example.net NS IP:10.0.0.50

    $TTL 86400 ; 24 hours $ORIGIN na.hr.example.net @ 1D IN SOA @ root (20200322001 3H 15 1w 3h) @ 1D IN NS @ ns3.na.hr.example.net. IN A 10.0.0.50 test.na.hr.example.com IN A 9.10.11.12
Route 53 Resolver 设置
  • 对于 Route 53 Resolver,您需要设置转发规则和委托规则:

    转发规则

    1. 对于转发初始请求,以便将查询转发到位于中心位置的父托管区 hr.example.com

      domain-name:hr.example.com target-ips:10.0.0.20

    2. 为了转发 out-of-zone委派记录,因此 Route 53 解析器知道委托域名服务器的 IP 地址来转发初始请求:

      domain-name:hr.example.net target-ips:10.0.0.50

    委托规则

    1. 区域内委托的委托规则:

      委托记录:hr.example.com

    2. 区域外委托的委托规则:

      委托记录:hr.example.net