

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 [AWS SDK 範例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 搭配使用 `GetHostedZone` 與 CLI
<a name="route-53_example_route-53_GetHostedZone_section"></a>

下列程式碼範例示範如何使用 `GetHostedZone`。

------
#### [ CLI ]

**AWS CLI**  
**取得託管區域的相關資訊**  
下列 `get-hosted-zone` 命令會使用 `Z1R8UBAEXAMPLE` 的 `id` 取得託管區域的相關資訊：  

```
aws route53 get-hosted-zone --id Z1R8UBAEXAMPLE
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [GetHostedZone](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/route53/get-hosted-zone.html)。

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**範例 1：傳回具 ID Z1D633PJN98FT9 之託管區域的詳細資訊。**  

```
Get-R53HostedZone -Id Z1D633PJN98FT9
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V4)》**中的 [GetHostedZone](https://docs.aws.amazon.com/powershell/v4/reference)。

**Tools for PowerShell V5**  
**範例 1：傳回具 ID Z1D633PJN98FT9 之託管區域的詳細資訊。**  

```
Get-R53HostedZone -Id Z1D633PJN98FT9
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V5)》**中的 [GetHostedZone](https://docs.aws.amazon.com/powershell/v5/reference)。

------