

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# リゾルバーの委任ルールのチュートリアル
<a name="outbound-delegation-tutorial"></a>

 委任ルールにより、VPC Resolver は指定されたアウトバウンドエンドポイントを介して委任ゾーンをホストするネームサーバーに到達できます。転送ルールは、DNS クエリをアウトバウンドエンドポイントを介して指定されたドメインに一致するネームサーバーに転送するように VPC リゾルバーに通知しますが、委任ルールは、委任 NS レコードが返されたときに指定されたアウトバウンドエンドポイントを介して委任ネームサーバーに到達するように VPC リゾルバーに通知します。VPC Resolver は、DNS レスポンスの NS レコードが委任レコードで指定されたドメイン名と一致すると、委任ネームサーバーにクエリを送信します。

## Resolver エンドポイントのアウトバウンド委任を使用するステップ
<a name="delegation-steps"></a>

1. DNS クエリの送信元の VPC に、ネットワーク上のリゾルバーへのリゾルバーアウトバウンドエンドポイントを作成します。

   次の API または CLI コマンドを使用できます。
   + [`CreateResolverEndpoint` API](https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_CreateResolverEndpoint.html)
   + [`create-resolver-endpoint` CLI](https://docs.aws.amazon.com/cli/latest/reference/route53resolver/create-resolver-endpoint.html)

1. 指定されたアウトバウンドエンドポイントを介してクエリをネットワークに委任するドメイン名を指定する 1 つ以上の委任ルールを作成します。

   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
   ```

1. クエリを委任する VPC に委任ルールを関連付けます。

   次の API または CLI コマンドを使用できます。
   + [AssociateResolverRule](https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_AssociateResolverRule.html) API。
   + [associate-resolver-rules](https://docs.aws.amazon.com/cli/latest/reference/route53resolver/associate-resolver-rule.html) CLI コマンド。

## Resolver アウトバウンドエンドポイントでサポートされている委任のタイプ
<a name="delegation-types"></a>

VPC Resolver は、次の 2 種類のアウトバウンド委任をサポートしています。
+ Route 53 プライベートホストゾーンから VPC Resolver へのアウトバウンド委任:

   アウトバウンド委任を使用して、プライベートホストゾーンからインターネット上のオンプレミス DNS サーバーまたはパブリックホストゾーンにサブドメインを委任します。このアウトバウンド委任により、プライベートホストゾーンと委任ゾーン間で DNS レコードの管理を分割できます。委任は、DNS 設定に基づいてプライベートホストゾーンのグルーレコードの有無にかかわらず行うことができます。詳細については「[プライベートホストゾーンからアウトバウンドへ](#phz-to-outbound-delegation)」を参照してください。
+ VPC リゾルバーのアウトバウンドからアウトバウンドへの委任:

   アウトバウンドからアウトバウンドへの委任を使用して、オンプレミス DNS サーバーから同じ場所または異なる場所にある別のオンプレミスサーバーにサブドメインを委任します。これは、プライベートホストゾーンからアウトバウンドエンドポイントに委任する場合に似ており、オンプレミスのネームサーバーでホストされているゾーンに委任できます。詳細については、「[アウトバウンドからアウトバウンドへ](#outbound-to-outbound-delegation)」を参照してください。

### Route 53 プライベートホストゾーンから VPC Resolver へのアウトバウンド委任の設定例
<a name="phz-to-outbound-delegation"></a>

 親ホストゾーンが Amazon VPC の Route 53 プライベートホストゾーンでホストされ、サブドメインが欧州、アジア、北米でホストされているネームサーバーに委任されている DNS 設定を考えてみます。すべての DNS クエリは VPC リゾルバーに渡されます。

手順に従って、プライベートホストゾーンと VPC リゾルバーを設定します。

**アウトバウンド委任のプライベートホストゾーンを設定する**

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
   ```

1. 欧州のオンプレミスリージョンのオンプレミスネームサーバーの場合:
   + ホストゾーン: `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
   ```

1. アジアのオンプレミスリージョンのオンプレミスネームサーバーの場合:

   ホストゾーン: `apac.hr.example.com`、`10.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.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
   ```

1. 北米のオンプレミスリージョンのオンプレミスネームサーバーの場合:

   ホストゾーン: `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
   ```

**VPC リゾルバーのセットアップ**
+ VPC リゾルバーでは、1 つのフォワードルールと 2 つの委任ルールを設定する必要があります。

  **転送ルール**

  1. ゾーンout-of-zone委任レコードを転送する場合、Route 53 VPC Resolver は最初のリクエストを転送する委任 NS の IP を認識します。

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

  **委任ルール**

  1. ゾーン内の委任の委任ルール:

     委任レコード: `hr.example.com`

  1. ゾーン外の委任の委任ルール:

     委任レコード: `hr.example.net`

### アウトバウンドからアウトバウンドへの委任の設定例
<a name="outbound-to-outbound-delegation"></a>

 親ホストゾーンを Amazon VPC に配置する代わりに、親ホストゾーンが中央のオンプレミスロケーションにあり、サブドメインが欧州、アジア、北米でホストされているネームサーバーに委任されている DNS 設定を考えてみます。すべての DNS クエリは VPC リゾルバーに渡されます。

手順に従って、オンプレミス DNS と VPC リゾルバーを設定します。

**オンプレミス 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
   ```

1.  欧州のオンプレミスリージョンのオンプレミスネームサーバーの場合 (欧州、アジア、北米のネームサーバーの設定は、プライベートホストゾーンからアウトバウンドへの委任の場合と同じ)。
   + ホストゾーン: `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
   ```

1. アジアのオンプレミスリージョンのオンプレミスネームサーバーの場合:

   ホストゾーン: `apac.hr.example.com`、`10.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.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
   ```

1. 北米のオンプレミスリージョンのオンプレミスネームサーバーの場合:

   ホストゾーン: `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
   ```

**VPC リゾルバーのセットアップ**
+ VPC リゾルバーでは、フォワードルールと委任ルールを設定する必要があります。

  **転送ルール**

  1. クエリが中央ロケーションの親ホストゾーン `hr.example.com` に転送されるように最初のリクエストを転送するには:

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

  1. ゾーンout-of-zone委任レコードを転送する場合、VPC リゾルバーは、最初のリクエストを転送する委任ネームサーバーの IP アドレスを認識します。

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

  **委任ルール**

  1. ゾーン内の委任の委任ルール:

     委任レコード: `hr.example.com`

  1. ゾーン外の委任の委任ルール:

     委任レコード: `hr.example.net`