

# AWS CLI を使用する Route 53 のドメイン登録例
<a name="cli_route-53-domains_code_examples"></a>

次のコード例は、Route 53 ドメイン登録 で AWS Command Line Interface を使用してアクションを実行し、一般的なシナリオを実装する方法を示しています。

*アクション*はより大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。アクションは個々のサービス機能を呼び出す方法を示していますが、コンテキスト内のアクションは、関連するシナリオで確認できます。

各例には完全なソースコードへのリンクが含まれており、コードの設定方法と実行方法に関する手順を確認できます。

**Topics**
+ [アクション](#actions)

## アクション
<a name="actions"></a>

### `check-domain-availability`
<a name="route-53-domains_CheckDomainAvailability_cli_topic"></a>

次のコード例は、`check-domain-availability` を使用する方法を示しています。

**AWS CLI**  
**Route 53 を使用してドメイン名を登録できるかどうかを確認するには**  
次の `check-domain-availability` コマンドは、Route 53 を使用してドメイン名 `example.com` を登録できるかどうかに関する情報を返します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains check-domain-availability \
    --region us-east-1 \
    --domain-name example.com
```
出力:  

```
{
    "Availability": "UNAVAILABLE"
}
```
Route 53 は、`.com` や `.jp` など、多数の最上位ドメイン (TLD) をサポートしていますが、利用可能なすべての TLD をサポートしているわけではありません。ドメインの可用性を確認し、Route 53 が TLD をサポートしていない場合、`check-domain-availability` は次のメッセージを返します。  

```
An error occurred (UnsupportedTLD) when calling the CheckDomainAvailability operation: <top-level domain> tld is not supported.
```
Route 53 を使用してドメインを登録する時に使用できる TLD の一覧については、「*Amazon Route 53 デベロッパーガイド*」の「[Amazon Route 53 に登録できるドメイン](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html)」を参照してください。Amazon Route 53 を使用してドメインを登録する方法の詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[新しいドメインを登録する](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-register.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[CheckDomainAvailability](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/check-domain-availability.html)」を参照してください。

### `check-domain-transferability`
<a name="route-53-domains_CheckDomainTransferability_cli_topic"></a>

次のコード例は、`check-domain-transferability` を使用する方法を示しています。

**AWS CLI**  
**Route 53 にドメインを転送できるかどうかを確認するには**  
次の `check-domain-transferability` コマンドは、ドメイン名 `example.com` を Route 53 に転送できるかどうかに関する情報を返します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains check-domain-transferability \
    --region us-east-1 \
    --domain-name example.com
```
出力:  

```
{
    "Transferability": {
        "Transferable": "UNTRANSFERABLE"
    }
}
```
詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[ドメイン登録の Amazon Route 53 への移管](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-transfer-to-route-53.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[CheckDomainTransferability](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/check-domain-transferability.html)」を参照してください。

### `delete-tags-for-domain`
<a name="route-53-domains_DeleteTagsForDomain_cli_topic"></a>

次のコード例は、`delete-tags-for-domain` を使用する方法を示しています。

**AWS CLI**  
**ドメインのタグを削除するには**  
次の `delete-tags-for-domain` コマンドは、指定されたドメインから 3 つのタグを削除します。タグ値ではなく、タグキーのみを指定することに注意してください。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains delete-tags-for-domain \
    --region us-east-1 \
    --domain-name example.com \
    --tags-to-delete accounting-key hr-key engineering-key
```
このコマンドでは何も出力されません。  
タグが削除されたことを確認するには、[list-tags-for-domain](https://docs.aws.amazon.com/cli/latest/reference/route53domains/list-tags-for-domain.html) を実行します。詳細については、「Amazon Route 53 デベロッパーガイド」の「[Tagging Amazon Route 53 Resources](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/tagging-resources.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DeleteTagsForDomain](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/delete-tags-for-domain.html)」を参照してください。

### `disable-domain-auto-renew`
<a name="route-53-domains_DisableDomainAutoRenew_cli_topic"></a>

次のコード例は、`disable-domain-auto-renew` を使用する方法を示しています。

**AWS CLI**  
**ドメインの自動更新を無効にするには**  
次の `disable-domain-auto-renew` のコマンドは、ドメインの登録の有効期限が切れる前にドメイン `example.com` を自動的に更新*しないように* Route 53 を設定します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains disable-domain-auto-renew \
    --region us-east-1 \
    --domain-name example.com
```
このコマンドでは何も出力されません。  
設定が変更されたことを確認するには、[get-domain-detail](https://docs.aws.amazon.com/cli/latest/reference/route53domains/get-domain-detail.html) を実行します。自動更新が無効になっている場合、`AutoRenew` の値は `False` となります。自動更新の詳細については、「*Amazon Route 53デベロッパーガイド*」の「Renewing Registration for a Domain <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-renew.html>」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DisableDomainAutoRenew](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/disable-domain-auto-renew.html)」を参照してください。

### `disable-domain-transfer-lock`
<a name="route-53-domains_DisableDomainTransferLock_cli_topic"></a>

次のコード例は、`disable-domain-transfer-lock` を使用する方法を示しています。

**AWS CLI**  
**ドメインの転送ロックを無効にするには**  
次の `disable-domain-transfer-lock` のコマンドは、ドメインを別のレジストラに転送できるように、ドメイン `example.com` の転送ロックを削除します。このコマンドは `clientTransferProhibited` ステータスを変更します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains disable-domain-transfer-lock \
    --region us-east-1 \
    --domain-name example.com
```
出力:  

```
{
    "OperationId": "3f28e0ac-126a-4113-9048-cc930example"
}
```
転送ロックが変更されていることを確認するには、[get-domain-detail](https://docs.aws.amazon.com/cli/latest/reference/route53domains/get-domain-detail.html) を実行します。転送ロックが無効になっている場合、`StatusList` の値には `clientTransferProhibited` が*含まれません*。  
転送プロセスの詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Transferring a Domain from Amazon Route 53 to Another Registrar](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-transfer-from-route-53.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[DisableDomainTransferLock](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/disable-domain-transfer-lock.html)」を参照してください。

### `enable-domain-auto-renew`
<a name="route-53-domains_EnableDomainAutoRenew_cli_topic"></a>

次のコード例は、`enable-domain-auto-renew` を使用する方法を示しています。

**AWS CLI**  
**ドメインの自動更新を有効にするには**  
次の `enable-domain-auto-renew` のコマンドは、ドメインの登録の有効期限が切れる前にドメイン `example.com` を自動的に更新するように Route 53 を設定します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains enable-domain-auto-renew \
    --region us-east-1 \
    --domain-name example.com
```
このコマンドでは何も出力されません。設定が変更されたことを確認するには、[get-domain-detail](https://docs.aws.amazon.com/cli/latest/reference/route53domains/get-domain-detail.html) を実行します。自動更新が有効になっている場合、`AutoRenew` の値は `True` です。  
自動更新の詳細については、「*Amazon Route 53デベロッパーガイド*」の「Renewing Registration for a Domain <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-renew.html>」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[EnableDomainAutoRenew](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/enable-domain-auto-renew.html)」を参照してください。

### `enable-domain-transfer-lock`
<a name="route-53-domains_EnableDomainTransferLock_cli_topic"></a>

次のコード例は、`enable-domain-transfer-lock` を使用する方法を示しています。

**AWS CLI**  
**ドメインで転送ロックを有効にするには**  
次の `enable-domain-transfer-lock` のコマンドは、指定されたドメインをロックして、別のレジストラに転送できないようにします。このコマンドは `clientTransferProhibited` ステータスを変更します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains enable-domain-transfer-lock \
    --region us-east-1 \
    --domain-name example.com
```
出力:  

```
{
    "OperationId": "3f28e0ac-126a-4113-9048-cc930example"
}
```
転送ロックが変更されていることを確認するには、[get-domain-detail](https://docs.aws.amazon.com/cli/latest/reference/route53domains/get-domain-detail.html) を実行します。転送ロックを有効にすると、`StatusList` の値には `clientTransferProhibited` が含まれます。  
転送プロセスの詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Transferring a Domain from Amazon Route 53 to Another Registrar](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-transfer-from-route-53.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[EnableDomainTransferLock](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/enable-domain-transfer-lock.html)」を参照してください。

### `get-contact-reachability-status`
<a name="route-53-domains_GetContactReachabilityStatus_cli_topic"></a>

次のコード例は、`get-contact-reachability-status` を使用する方法を示しています。

**AWS CLI**  
**登録者の連絡先が確認メールに応答したかどうかを判断するには**  
次の `get-contact-reachability-status` コマンドは、指定されたドメインの登録者の連絡先が確認 E メールに応答したかどうかに関する情報を返します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains get-contact-reachability-status \
    --region us-east-1 \
    --domain-name example.com
```
出力:  

```
{
    "domainName": "example.com",
    "status": "DONE"
}
```
詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Resending Authorization and Confirmation Emails](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-click-email-link.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetContactReachabilityStatus](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/get-contact-reachability-status.html)」を参照してください。

### `get-domain-detail`
<a name="route-53-domains_GetDomainDetail_cli_topic"></a>

次のコード例は、`get-domain-detail` を使用する方法を示しています。

**AWS CLI**  
**指定されたドメインに関する詳細情報を取得するには**  
次の `get-domain-detail` コマンドは、指定されたドメインに関する詳細情報を表示します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains get-domain-detail \
    --region us-east-1 \
    --domain-name example.com
```
出力:  

```
{
    "DomainName": "example.com",
    "Nameservers": [
        {
            "Name": "ns-2048.awsdns-64.com",
            "GlueIps": []
        },
        {
            "Name": "ns-2049.awsdns-65.net",
            "GlueIps": []
        },
        {
            "Name": "ns-2050.awsdns-66.org",
            "GlueIps": []
        },
        {
            "Name": "ns-2051.awsdns-67.co.uk",
            "GlueIps": []
        }
    ],
    "AutoRenew": true,
    "AdminContact": {
        "FirstName": "Saanvi",
        "LastName": "Sarkar",
        "ContactType": "COMPANY",
        "OrganizationName": "Example",
        "AddressLine1": "123 Main Street",
        "City": "Anytown",
        "State": "WA",
        "CountryCode": "US",
        "ZipCode": "98101",
        "PhoneNumber": "+1.8005551212",
        "Email": "ssarkar@example.com",
        "ExtraParams": []
    },
    "RegistrantContact": {
        "FirstName": "Alejandro",
        "LastName": "Rosalez",
        "ContactType": "COMPANY",
        "OrganizationName": "Example",
        "AddressLine1": "123 Main Street",
        "City": "Anytown",
        "State": "WA",
        "CountryCode": "US",
        "ZipCode": "98101",
        "PhoneNumber": "+1.8005551212",
        "Email": "arosalez@example.com",
        "ExtraParams": []
    },
    "TechContact": {
        "FirstName": "Wang",
        "LastName": "Xiulan",
        "ContactType": "COMPANY",
        "OrganizationName": "Example",
        "AddressLine1": "123 Main Street",
        "City": "Anytown",
        "State": "WA",
        "CountryCode": "US",
        "ZipCode": "98101",
        "PhoneNumber": "+1.8005551212",
        "Email": "wxiulan@example.com",
        "ExtraParams": []
    },
    "AdminPrivacy": true,
    "RegistrantPrivacy": true,
    "TechPrivacy": true,
    "RegistrarName": "Amazon Registrar, Inc.",
    "WhoIsServer": "whois.registrar.amazon",
    "RegistrarUrl": "http://registrar.amazon.com",
    "AbuseContactEmail": "abuse@registrar.amazon.com",
    "AbuseContactPhone": "+1.2062661000",
    "CreationDate": 1444934889.601,
    "ExpirationDate": 1602787689.0,
    "StatusList": [
        "clientTransferProhibited"
    ]
}
```
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetDomainDetail](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/get-domain-detail.html)」を参照してください。

### `get-domain-suggestions`
<a name="route-53-domains_GetDomainSuggestions_cli_topic"></a>

次のコード例は、`get-domain-suggestions` を使用する方法を示しています。

**AWS CLI**  
**推奨されるドメイン名のリストを取得するには**  
次の `get-domain-suggestions` コマンドは、ドメイン名 `example.com` に基づいて推奨されるドメイン名のリストを表示します。レスポンスには、利用可能なドメイン名のみが含まれます。このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains get-domain-suggestions \
    --region us-east-1 \
    --domain-name example.com \
    --suggestion-count 10 \
    --only-available
```
出力:  

```
{
    "SuggestionsList": [
        {
            "DomainName": "egzaampal.com",
            "Availability": "AVAILABLE"
        },
        {
            "DomainName": "examplelaw.com",
            "Availability": "AVAILABLE"
        },
        {
            "DomainName": "examplehouse.net",
            "Availability": "AVAILABLE"
        },
        {
            "DomainName": "homeexample.net",
            "Availability": "AVAILABLE"
        },
        {
            "DomainName": "examplelist.com",
            "Availability": "AVAILABLE"
       },
        {
            "DomainName": "examplenews.net",
            "Availability": "AVAILABLE"
        },
        {
            "DomainName": "officeexample.com",
            "Availability": "AVAILABLE"
        },
        {
            "DomainName": "exampleworld.com",
            "Availability": "AVAILABLE"
        },
        {
            "DomainName": "exampleart.com",
            "Availability": "AVAILABLE"
        }
    ]
}
```
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetDomainSuggestions](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/get-domain-suggestions.html)」を参照してください。

### `get-operation-detail`
<a name="route-53-domains_GetOperationDetail_cli_topic"></a>

次のコード例は、`get-operation-detail` を使用する方法を示しています。

**AWS CLI**  
**オペレーションの現在のステータスを取得するには**  
一部のドメイン登録オペレーションは非同期的に動作し、完了する前にレスポンスを返します。これらのオペレーションは、現在のステータスを取得するために使用できるオペレーション ID を返します。次の `get-operation-detail` コマンドは、指定されたオペレーションのステータスを返します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains get-operation-detail \
    --region us-east-1 \
    --operation-id edbd8d63-7fe7-4343-9bc5-54033example
```
出力:  

```
{
    "OperationId": "edbd8d63-7fe7-4343-9bc5-54033example",
    "Status": "SUCCESSFUL",
    "DomainName": "example.com",
    "Type": "DOMAIN_LOCK",
    "SubmittedDate": 1573749367.864
}
```
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[GetOperationDetail](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/get-operation-detail.html)」を参照してください。

### `list-domains`
<a name="route-53-domains_ListDomains_cli_topic"></a>

次のコード例は、`list-domains` を使用する方法を示しています。

**AWS CLI**  
**現在の AWS アカウントに登録されているドメインを一覧表示するには**  
次の `list-domains` コマンドを使用して、現在の AWS アカウントに関連付けられているドメインに関する概要情報を一覧表示します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains list-domains
    --region us-east-1
```
出力:  

```
{
    "Domains": [
        {
            "DomainName": "example.com",
            "AutoRenew": true,
            "TransferLock": true,
            "Expiry": 1602712345.0
        },
        {
            "DomainName": "example.net",
            "AutoRenew": true,
            "TransferLock": true,
            "Expiry": 1602723456.0
        },
        {
            "DomainName": "example.org",
            "AutoRenew": true,
            "TransferLock": true,
            "Expiry": 1602734567.0
        }
    ]
}
```
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ListDomains](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/list-domains.html)」を参照してください。

### `list-operations`
<a name="route-53-domains_ListOperations_cli_topic"></a>

次のコード例は、`list-operations` を使用する方法を示しています。

**AWS CLI**  
**オペレーション ID を返すオペレーションのステータスを一覧表示するには**  
一部のドメイン登録オペレーションは非同期的に実行され、完了する前にレスポンスを返します。これらのオペレーションは、現在のステータスを取得するために使用できるオペレーション ID を返します。次の `list-operations` コマンドは、現在のドメイン登録オペレーションに関するステータスを含む概要情報を一覧表示します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains list-operations
    --region us-east-1
```
出力:  

```
{
    "Operations": [
        {
            "OperationId": "aab9822f-1da0-4bf3-8a15-fd4e0example",
            "Status": "SUCCESSFUL",
            "Type": "DOMAIN_LOCK",
            "SubmittedDate": 1455321739.986
        },
        {
            "OperationId": "c24379ed-76be-42f8-bdad-9379bexample",
            "Status": "SUCCESSFUL",
            "Type": "UPDATE_NAMESERVER",
            "SubmittedDate": 1468960475.109
        },
        {
            "OperationId": "f47e1297-ef9e-4c2b-ae1e-a5fcbexample",
            "Status": "SUCCESSFUL",
            "Type": "RENEW_DOMAIN",
            "SubmittedDate": 1473561835.943
        },
        {
            "OperationId": "75584f23-b15f-459e-aed7-dc6f5example",
            "Status": "SUCCESSFUL",
            "Type": "UPDATE_DOMAIN_CONTACT",
            "SubmittedDate": 1547501003.41
        }
    ]
}
```
出力には、オペレーション ID を返し、現在の AWS アカウントを使用して登録したすべてのドメインで実行したすべてのオペレーションが含まれます。指定した日付以降に送信したオペレーションのみを取得する場合は、`submitted-since` パラメータを含めて、Unix 形式と協定世界時 (UTC) で日付を指定できます。次のコマンドは、2020 年 1 月 1 日の UTC 午前 12 時以降に送信されたすべてのオペレーションのステータスを取得します。  

```
aws route53domains list-operations \
    --submitted-since 1577836800
```
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ListOperations](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/list-operations.html)」を参照してください。

### `list-tags-for-domain`
<a name="route-53-domains_ListTagsForDomain_cli_topic"></a>

次のコード例は、`list-tags-for-domain` を使用する方法を示しています。

**AWS CLI**  
**ドメインのタグを一覧表示するには**  
次の `list-tags-for-domain` のコマンドは、指定されたドメインに現在関連付けられているタグを一覧表示します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains list-tags-for-domain \
    --region us-east-1 \
    --domain-name example.com
```
出力:  

```
{
    "TagList": [
        {
            "Key": "key1",
            "Value": "value1"
        },
        {
            "Key": "key2",
            "Value": "value2"
        }
    ]
}
```
詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Tagging Amazon Route 53 Resources](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/tagging-resources.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ListTagsForDomain](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/list-tags-for-domain.html)」を参照してください。

### `register-domain`
<a name="route-53-domains_RegisterDomain_cli_topic"></a>

次のコード例は、`register-domain` を使用する方法を示しています。

**AWS CLI**  
**ドメインを登録するには**  
次の `register-domain` コマンドはドメインを登録し、JSON 形式のファイルからすべてのパラメータ値を取得します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains register-domain \
    --region us-east-1 \
    --cli-input-json file://register-domain.json
```
`register-domain.json` の内容:  

```
{
    "DomainName": "example.com",
    "DurationInYears": 1,
    "AutoRenew": true,
    "AdminContact": {
        "FirstName": "Martha",
        "LastName": "Rivera",
        "ContactType": "PERSON",
        "OrganizationName": "Example",
        "AddressLine1": "1 Main Street",
        "City": "Anytown",
        "State": "WA",
        "CountryCode": "US",
        "ZipCode": "98101",
        "PhoneNumber": "+1.8005551212",
        "Email": "mrivera@example.com"
    },
    "RegistrantContact": {
        "FirstName": "Li",
        "LastName": "Juan",
        "ContactType": "PERSON",
        "OrganizationName": "Example",
        "AddressLine1": "1 Main Street",
        "City": "Anytown",
        "State": "WA",
        "CountryCode": "US",
        "ZipCode": "98101",
        "PhoneNumber": "+1.8005551212",
        "Email": "ljuan@example.com"
    },
    "TechContact": {
        "FirstName": "Mateo",
        "LastName": "Jackson",
        "ContactType": "PERSON",
        "OrganizationName": "Example",
        "AddressLine1": "1 Main Street",
        "City": "Anytown",
        "State": "WA",
        "CountryCode": "US",
        "ZipCode": "98101",
        "PhoneNumber": "+1.8005551212",
        "Email": "mjackson@example.com"
    },
    "PrivacyProtectAdminContact": true,
    "PrivacyProtectRegistrantContact": true,
    "PrivacyProtectTechContact": true
}
```
出力:  

```
{
    "OperationId": "b114c44a-9330-47d1-a6e8-a0b11example"
}
```
オペレーションが成功したことを確認するには、`get-operation-detail` を実行します。詳細については、「[get-operation-detail](https://docs.aws.amazon.com/cli/latest/reference/route53domains/get-operation-detail.html)」を参照してください。  
詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[新しいドメインの登録](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-register.html)」を参照してください。  
`ExtraParams` の最上位ドメイン (TLD) に必要な値と有効な値については「*Amazon Route 53 API リファレンス*」の「[ExtraParam](https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_ExtraParam.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[RegisterDomain](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/register-domain.html)」を参照してください。

### `renew-domain`
<a name="route-53-domains_RenewDomain_cli_topic"></a>

次のコード例は、`renew-domain` を使用する方法を示しています。

**AWS CLI**  
**ドメインを更新するには**  
次の `renew-domain` コマンドは、指定されたドメインを 5 年間更新します。`current-expiry-year` の値を取得するには、`get-domain-detail` コマンドを使用し、Unix 形式から `ExpirationDate` の値を変換します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains renew-domain \
    --region us-east-1 \
    --domain-name example.com \
    --duration-in-years 5 \
    --current-expiry-year 2020
```
出力:  

```
{
    "OperationId": "3f28e0ac-126a-4113-9048-cc930example"
}
```
オペレーションが成功したことを確認するには、`get-operation-detail` を実行します。詳細については、「[get-operation-detail](https://docs.aws.amazon.com/cli/latest/reference/route53domains/get-operation-detail.html)」を参照してください。  
.com や .org など、各最上位ドメイン (TLD) のレジストリは、ドメインを更新できる最大年数を制御します。ドメインの最大更新期間を取得するには、「*Amazon Route 53 デベロッパーガイド*」の「[Domains That You Can Register with Amazon Route 53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html)」のTLD の登録と更新期間についてのセクションを参照してください。  
詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Renewing Registration for a Domain](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-renew.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[RenewDomain](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/renew-domain.html)」を参照してください。

### `resend-contact-reachability-email`
<a name="route-53-domains_ResendContactReachabilityEmail_cli_topic"></a>

次のコード例は、`resend-contact-reachability-email` を使用する方法を示しています。

**AWS CLI**  
**登録者の連絡先の現在の E メールアドレスに確認 E メールを再送信するには**  
次の `resend-contact-reachability-email` コマンドは、example.com ドメインの登録者の連絡先の現在の E メールアドレスに確認 E メールを再送信します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains resend-contact-reachability-email \
    --region us-east-1 \
    --domain-name example.com
```
出力:  

```
{
    "domainName": "example.com",
    "emailAddress": "moliveira@example.com",
    "isAlreadyVerified": true
}
```
この例のように、`isAlreadyVerified` の値が `true` の場合、登録者の連絡先は、指定された E メールアドレスに到達可能であることを既に確認しています。  
詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Resending Authorization and Confirmation Emails](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-click-email-link.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ResendContactReachabilityEmail](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/resend-contact-reachability-email.html)」を参照してください。

### `retrieve-domain-auth-code`
<a name="route-53-domains_RetrieveDomainAuthCode_cli_topic"></a>

次のコード例は、`retrieve-domain-auth-code` を使用する方法を示しています。

**AWS CLI**  
**ドメインの承認コードを取得して、ドメインを別のレジストラに転送できるようにするには**  
次の `retrieve-domain-auth-code` コマンドは、example.com ドメインの現在の承認コードを取得します。この値を別のドメインレジストラに渡すのは、ドメインをそのレジストラに転送する場合です。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains retrieve-domain-auth-code \
    --region us-east-1 \
    --domain-name example.com
```
出力:  

```
{
    "AuthCode": ")o!v3dJeXampLe"
}
```
詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Transferring a Domain from Amazon Route 53 to Another Registrar](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-transfer-from-route-53.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[RetrieveDomainAuthCode](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/retrieve-domain-auth-code.html)」を参照してください。

### `transfer-domain`
<a name="route-53-domains_TransferDomain_cli_topic"></a>

次のコード例は、`transfer-domain` を使用する方法を示しています。

**AWS CLI**  
**Amazon Route 53 にドメインを転送するには**  
次の `transfer-domain` コマンドは、JSON 形式のファイル `C:\temp\transfer-domain.json` によって提供されるパラメータを使用して、ドメインを Route 53 に転送します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains transfer-domain \
    --region us-east-1 \
    --cli-input-json file://C:\temp\transfer-domain.json
```
`transfer-domain.json` の内容:  

```
{
    "DomainName": "example.com",
    "DurationInYears": 1,
    "Nameservers": [
        {
            "Name": "ns-2048.awsdns-64.com"
        },
        {
            "Name": "ns-2049.awsdns-65.net"
        },
        {
            "Name": "ns-2050.awsdns-66.org"
        },
        {
            "Name": "ns-2051.awsdns-67.co.uk"
        }
    ],
    "AuthCode": ")o!v3dJeXampLe",
    "AutoRenew": true,
    "AdminContact": {
        "FirstName": "Martha",
        "LastName": "Rivera",
        "ContactType": "PERSON",
        "OrganizationName": "Example",
        "AddressLine1": "1 Main Street",
        "City": "Anytown",
        "State": "WA",
        "CountryCode": "US",
        "ZipCode": "98101",
        "PhoneNumber": "+1.8005551212",
        "Email": "mrivera@example.com"
    },
    "RegistrantContact": {
        "FirstName": "Li",
        "LastName": "Juan",
        "ContactType": "PERSON",
        "OrganizationName": "Example",
        "AddressLine1": "1 Main Street",
        "City": "Anytown",
        "State": "WA",
        "CountryCode": "US",
        "ZipCode": "98101",
        "PhoneNumber": "+1.8005551212",
        "Email": "ljuan@example.com"
    },
    "TechContact": {
        "FirstName": "Mateo",
        "LastName": "Jackson",
        "ContactType": "PERSON",
        "OrganizationName": "Example",
        "AddressLine1": "1 Main Street",
        "City": "Anytown",
        "State": "WA",
        "CountryCode": "US",
        "ZipCode": "98101",
        "PhoneNumber": "+1.8005551212",
        "Email": "mjackson@example.com"
    },
    "PrivacyProtectAdminContact": true,
    "PrivacyProtectRegistrantContact": true,
    "PrivacyProtectTechContact": true
}
```
出力:  

```
{
    "OperationId": "b114c44a-9330-47d1-a6e8-a0b11example"
}
```
オペレーションが成功したことを確認するには、`get-operation-detail` を実行します。詳細については、「[get-operation-detail](https://docs.aws.amazon.com/cli/latest/reference/route53domains/get-operation-detail.html)」を参照してください。  
詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Transferring Registration for a Domain to Amazon Route 53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-transfer-to-route-53.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[TransferDomain](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/transfer-domain.html)」を参照してください。

### `update-domain-contact-privacy`
<a name="route-53-domains_UpdateDomainContactPrivacy_cli_topic"></a>

次のコード例は、`update-domain-contact-privacy` を使用する方法を示しています。

**AWS CLI**  
**ドメインの連絡先のプライバシー設定を更新するには**  
次の `update-domain-contact-privacy` コマンドは、example.com ドメインの管理連絡先のプライバシー保護をオフにします。このコマンドは `us-east-1` リージョンでのみ実行されます。  
デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains update-domain-contact-privacy \
    --region us-east-1 \
    --domain-name example.com \
    --no-admin-privacy
```
出力:  

```
{
    "OperationId": "b3a219e9-d801-4244-b533-b7256example"
}
```
オペレーションが成功したことを確認するには、`get-operation-detail` を実行します。詳細については、「[get-operation-detail](https://docs.aws.amazon.com/cli/latest/reference/route53domains/get-operation-detail.html)」を参照してください。  
詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Enabling or Disabling Privacy Protection for Contact Information for a Domain](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-privacy-protection.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UpdateDomainContactPrivacy](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/update-domain-contact-privacy.html)」を参照してください。

### `update-domain-contact`
<a name="route-53-domains_UpdateDomainContact_cli_topic"></a>

次のコード例は、`update-domain-contact` を使用する方法を示しています。

**AWS CLI**  
**ドメインの連絡先情報を更新するには**  
次の `update-domain-contact` コマンドは、ドメインの連絡先情報を更新し、JSON 形式のファイル `C:\temp\update-domain-contact.json` からパラメータを取得します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains update-domain-contact \
    --region us-east-1 \
    --cli-input-json file://C:\temp\update-domain-contact.json
```
`update-domain-contact.json` の内容:  

```
{
    "AdminContact": {
        "AddressLine1": "101 Main Street",
        "AddressLine2": "Suite 1a",
        "City": "Seattle",
        "ContactType": "COMPANY",
        "CountryCode": "US",
        "Email": "w.xiulan@example.com",
        "FirstName": "Wang",
        "LastName": "Xiulan",
        "OrganizationName": "Example",
        "PhoneNumber": "+1.8005551212",
        "State": "WA",
        "ZipCode": "98101"
    },
    "DomainName": "example.com",
    "RegistrantContact": {
        "AddressLine1": "101 Main Street",
        "AddressLine2": "Suite 1a",
        "City": "Seattle",
        "ContactType": "COMPANY",
        "CountryCode": "US",
        "Email": "w.xiulan@example.com",
        "FirstName": "Wang",
        "LastName": "Xiulan",
        "OrganizationName": "Example",
        "PhoneNumber": "+1.8005551212",
        "State": "WA",
        "ZipCode": "98101"
    },
    "TechContact": {
        "AddressLine1": "101 Main Street",
        "AddressLine2": "Suite 1a",
        "City": "Seattle",
        "ContactType": "COMPANY",
        "CountryCode": "US",
        "Email": "w.xiulan@example.com",
        "FirstName": "Wang",
        "LastName": "Xiulan",
        "OrganizationName": "Example",
        "PhoneNumber": "+1.8005551212",
        "State": "WA",
        "ZipCode": "98101"
    }
}
```
出力:  

```
{
    "OperationId": "b3a219e9-d801-4244-b533-b7256example"
}
```
オペレーションが成功したことを確認するには、[get-domain-detail](https://docs.aws.amazon.com/cli/latest/reference/route53domains/get-domain-detail.html) を実行します。詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Updating Contact Information for a Domain](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-update-contacts.html#domain-update-contacts-basic)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UpdateDomainContact](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/update-domain-contact.html)」を参照してください。

### `update-domain-nameservers`
<a name="route-53-domains_UpdateDomainNameservers_cli_topic"></a>

次のコード例は、`update-domain-nameservers` を使用する方法を示しています。

**AWS CLI**  
**ドメインのネームサーバーを更新するには**  
次の `update-domain-nameservers` コマンドは、ドメインのネームサーバーを更新します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains update-domain-nameservers \
    --region us-east-1 \
    --domain-name example.com \
    --nameservers Name=ns-1.awsdns-01.org Name=ns-2.awsdns-02.co.uk Name=ns-3.awsdns-03.net Name=ns-4.awsdns-04.com
```
出力:  

```
{
    "OperationId": "f1691ec4-0e7a-489e-82e0-b19d3example"
}
```
オペレーションが成功したことを確認するには、[get-domain-detail](https://docs.aws.amazon.com/cli/latest/reference/route53domains/get-domain-detail.html) を実行します。  
詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Adding or Changing Name Servers and Glue Records for a Domain](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-name-servers-glue-records.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UpdateDomainNameservers](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/update-domain-nameservers.html)」を参照してください。

### `update-tags-for-domain`
<a name="route-53-domains_UpdateTagsForDomain_cli_topic"></a>

次のコード例は、`update-tags-for-domain` を使用する方法を示しています。

**AWS CLI**  
**ドメインのタグを追加または更新するには**  
次の `update-tags-for-domain` コマンドは、example.com ドメインの 2 つのキーと対応する値を追加または更新します。キーの値を更新するには、キーと新しい値を含めます。タグを追加または更新できるのは、一度に 1 つのドメインのみです。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains update-tags-for-domain \
    --region us-east-1 \
    --domain-name example.com \
    --tags-to-update "Key=key1,Value=value1" "Key=key2,Value=value2"
```
このコマンドでは何も出力されません。タグが追加または更新されたことを確認するには、[list-tags-for-domain](https://docs.aws.amazon.com/cli/latest/reference/route53domains/list-tags-for-domain.html) を実行します。  
詳細については、「*Amazon Route 53 デベロッパーガイド*」の「[Tagging Amazon Route 53 Resources](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/tagging-resources.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[UpdateTagsForDomain](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/update-tags-for-domain.html)」を参照してください。

### `view-billing`
<a name="route-53-domains_ViewBilling_cli_topic"></a>

次のコード例は、`view-billing` を使用する方法を示しています。

**AWS CLI**  
**現在の AWS アカウントのドメイン登録料金に関する請求情報を取得するには**  
次の `view-billing` コマンドは、2018 年 1 月 1 日 (Unix 時間で 1514764800) から 2019 年 12 月 31 日深夜 (Unix 時間で 1577836800) までの間、現在のアカウントのすべてのドメイン関連の請求レコードを返します。  
このコマンドは `us-east-1` リージョンでのみ実行されます。デフォルトのリージョンが `us-east-1` に設定されている場合は、`region` パラメータを省略できます。  

```
aws route53domains view-billing \
    --region us-east-1 \
    --start-time 1514764800 \
    --end-time 1577836800
```
出力:  

```
{
    "BillingRecords": [
        {
            "DomainName": "example.com",
            "Operation": "RENEW_DOMAIN",
            "InvoiceId": "149962827",
            "BillDate": 1536618063.181,
            "Price": 12.0
        },
        {
            "DomainName": "example.com",
            "Operation": "RENEW_DOMAIN",
            "InvoiceId": "290913289",
            "BillDate": 1568162630.884,
            "Price": 12.0
        }
    ]
}
```
詳細については、「*Amazon Route 53 API リファレンス*」の「[ViewBilling](https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_ViewBilling.html)」を参照してください。  
+  API の詳細については、「*AWS CLI コマンドリファレンス*」の「[ViewBilling](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53domains/view-billing.html)」を参照してください。