AWS 文档 SDK 示例
将 ListHostedZonesByName 与 CLI 配合使用
以下代码示例演示如何使用 ListHostedZonesByName。
- CLI
-
- AWS CLI
-
以下命令最多列出 100 个按域名排序的托管区:
aws route53 list-hosted-zones-by-name输出:
{ "HostedZones": [ { "ResourceRecordSetCount": 2, "CallerReference": "test20150527-2", "Config": { "Comment": "test2", "PrivateZone": false }, "Id": "/hostedzone/Z119WBBTVP5WFX", "Name": "2.example.com." }, { "ResourceRecordSetCount": 2, "CallerReference": "test20150527-1", "Config": { "Comment": "test", "PrivateZone": false }, "Id": "/hostedzone/Z3P5QSUBK4POTI", "Name": "www.example.com." } ], "IsTruncated": false, "MaxItems": "100" }以下命令列出按名称排序的托管区,开头为
www.example.com:aws route53 list-hosted-zones-by-name --dns-namewww.example.com输出:
{ "HostedZones": [ { "ResourceRecordSetCount": 2, "CallerReference": "mwunderl20150527-1", "Config": { "Comment": "test", "PrivateZone": false }, "Id": "/hostedzone/Z3P5QSUBK4POTI", "Name": "www.example.com." } ], "DNSName": "www.example.com", "IsTruncated": false, "MaxItems": "100" }-
有关 API 详细信息,请参阅《AWS CLI 命令参考》中的 ListHostedZonesByName
。
-
- PowerShell
-
- Tools for PowerShell V4
-
示例 1:按照域名以 ASCII 顺序返回所有公有和私有托管区。
Get-R53HostedZonesByName示例 2:按照域名以 ASCII 顺序返回公有和私有托管区,开头为指定的 DNS 名称。
Get-R53HostedZonesByName -DnsName example2.com-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V4)》中的 ListHostedZonesByName。
-
- Tools for PowerShell V5
-
示例 1:按照域名以 ASCII 顺序返回所有公有和私有托管区。
Get-R53HostedZonesByName示例 2:按照域名以 ASCII 顺序返回公有和私有托管区,开头为指定的 DNS 名称。
Get-R53HostedZonesByName -DnsName example2.com-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V5)》中的 ListHostedZonesByName。
-
ListHostedZones
ListQueryLoggingConfigs