解析器委托规则教程 - Amazon Route 53
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

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

解析器委托规则教程

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

使用解析器端点出站委派的步骤

  1. 在 VPC 中创建一个 Route 53 解析器出站终端节点,您希望通过该终端节点向网络上的解析器发出 DNS 查询。

    您可以使用以下 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 解析器支持两种类型的出站委派:

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

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

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

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

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

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

按照示例步骤配置您的私有托管区域和 Route 53 解析器。

为出站委派配置私有托管区域
  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.comNS 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

    亚太域名服务器可以将子域名委托给其他域名服务器。

    $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.netNS 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 解析器设置
  • 对于 Route 53 Resolver,您需要设置一条转发规则和两条委托规则:

    转发规则

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

      域名:目标 IP:hr.example.net10.0.0.50

    委托规则

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

      委托记录:hr.example.com

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

      委托记录:hr.example.net

出站到出站委派示例配置

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

按照示例步骤配置您的本地 DNS 和 Route 53 解析器。

配置本地 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.comNS 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

    亚太域名服务器可以将子域名委托给其他域名服务器。

    $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.netNS 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 解析器设置
  • 对于 Route 53 Resolver,您需要设置转发规则和委托规则:

    转发规则

    1. 要转发初始请求,以便将查询转发到位于中心位置的父托管区域hr.example.com,请执行以下操作:

      域名:目标 IP:hr.example.com10.0.0.20

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

      域名:目标 IP:hr.example.net10.0.0.50

    委托规则

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

      代表团记录:hr.example.com

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

      委托记录:hr.example.net