本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
解析程序委托规则教程
委托规则允许 VPC 解析器通过指定的出站终端节点访问托管委派区域的域名服务器。虽然转发规则通知 VPC 解析器通过出站终端节点将 DNS 查询转发到与指定域名匹配的域名服务器,但委派规则通知 VPC 解析器通过返回委托的 NS 记录时指定的出站终端节点访问委派域名服务器。当 DNS 响应中的 NS 记录与委派记录中指定的域名匹配时,VPC 解析器会向委派域名服务器发送查询。
使用 Resolver 端点出站委托的步骤
在 VPC 中创建一个解析器出站终端节点,您希望通过该终端节点向网络上的解析器发出 DNS 查询。
您可以使用以下 API 或 CLI 命令:
创建一个或多个委托规则,这些规则指定应通过指定的出站端点将查询委托到您的网络的域名。
使用 CLI 创建委托规则的示例:
aws route53resolver create-resolver-rule \ --regionREGION\ --creator-request-iddelegateruletest\ --delegation-recordexample.com\ --namedelegateruletest\ --rule-type DELEGATE \ --resolver-endpoint-idoutbound endpoint ID将委托规则与您想要委托查询的委托规则相关联。 VPCs
您可以使用以下 API 或 CLI 命令:
-
associate-resolver-rulesCLI 命令。
Resolver 出站端点支持的委托类型
VPC 解析器支持两种类型的出站委派:
通往 VPC Resolver 的 Route 53 私有托管区域出站委派示例配置
假设有一个 DNS 设置,其中父托管区托管在 Amazon VPC 的 Route 53 私有托管区中,子域委托给在欧洲、亚洲和北美洲托管的名称服务器。所有 DNS 查询都通过 VPC 解析器传递。
按照示例步骤配置您的私有托管区域和 VPC 解析器。
配置出站委托的私有托管区
对于私有托管区设置:
父托管区:
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对于欧洲本地区域中的本地名称服务器:
托管区:
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对于亚洲本地区域中的本地名称服务器:
托管区:
apac.hr.example.com、10.0.0.40APAC 名称服务器可以将子域委托给其他名称服务器。
$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.com、10.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对于北美洲本地区域中的本地名称服务器:
托管区:
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
VPC 解析器设置
对于 VPC 解析器,您需要设置一条转发规则和两条委托规则:
转发规则
用于转发 out-of-zone委派记录,因此 Route 53 VPC 解析器知道委托的 NS 的 IP 以转发初始请求。
domain-name:
hr.example.nettarget-ips:10.0.0.50
委托规则
区域内委托的委托规则:
委托记录:
hr.example.com区域外委托的委托规则:
委托记录:
hr.example.net
出站到出站委托示例配置
不是将父托管区置于 Amazon VPC 中,而是假设有一个 DNS 设置,其中父托管区位于本地中心位置,而子域被委托给在欧洲、亚洲和北美洲托管的名称服务器。所有 DNS 查询都通过 VPC 解析器传递。
按照示例步骤配置您的本地 DNS 和 VPC 解析器。
配置本地 DNS
对于本地中心区域中的本地名称服务器:
父托管区:
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对于欧洲本地区域中的本地名称服务器(欧洲、亚洲和北美洲名称服务器的配置与私有托管区的出站委托配置相同):
托管区:
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对于亚洲本地区域中的本地名称服务器:
托管区:
apac.hr.example.com、10.0.0.40APAC 名称服务器可以将子域委托给其他名称服务器。
$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.com、10.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对于北美洲本地区域中的本地名称服务器:
托管区:
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
VPC 解析器设置
对于 VPC 解析器,您需要设置转发规则和委托规则:
转发规则
对于转发初始请求,以便将查询转发到位于中心位置的父托管区
hr.example.com:domain-name:
hr.example.comtarget-ips:10.0.0.20为了转发 out-of-zone委派记录,让 VPC 解析器知道委托域名服务器的 IP 地址来转发初始请求:
domain-name:
hr.example.nettarget-ips:10.0.0.50
委托规则
区域内委托的委托规则:
委托记录:
hr.example.com区域外委托的委托规则:
委托记录:
hr.example.net