选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

GetDomainDetail与 AWS SDK 或 CLI 配合使用

聚焦模式
GetDomainDetail与 AWS SDK 或 CLI 配合使用 - Amazon Route 53

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

以下代码示例演示如何使用 GetDomainDetail

操作示例是大型程序的代码摘录,必须在上下文中运行。在以下代码示例中,您可以查看此操作的上下文:

.NET
适用于 .NET 的 SDK
注意

还有更多相关信息 GitHub。查找完整示例,学习如何在 AWS 代码示例存储库中进行设置和运行。

/// <summary> /// Get details for a domain. /// </summary> /// <returns>A string with detail information about the domain.</returns> public async Task<string> GetDomainDetail(string domainName) { try { var result = await _amazonRoute53Domains.GetDomainDetailAsync( new GetDomainDetailRequest() { DomainName = domainName }); var details = $"\tDomain {domainName}:\n" + $"\tCreated on {result.CreationDate.ToShortDateString()}.\n" + $"\tAdmin contact is {result.AdminContact.Email}.\n" + $"\tAuto-renew is {result.AutoRenew}.\n"; return details; } catch (InvalidInputException) { return $"Domain {domainName} was not found in your account."; } }
  • 有关 API 的详细信息,请参阅 适用于 .NET 的 AWS SDK API 参考GetDomainDetail中的。

CLI
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.com", "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中的。

Java
适用于 Java 的 SDK 2.x
注意

还有更多相关信息 GitHub。查找完整示例,学习如何在 AWS 代码示例存储库中进行设置和运行。

public static void getDomainDetails(Route53DomainsClient route53DomainsClient, String domainSuggestion) { try { GetDomainDetailRequest detailRequest = GetDomainDetailRequest.builder() .domainName(domainSuggestion) .build(); GetDomainDetailResponse response = route53DomainsClient.getDomainDetail(detailRequest); System.out.println("The contact first name is " + response.registrantContact().firstName()); System.out.println("The contact last name is " + response.registrantContact().lastName()); System.out.println("The contact org name is " + response.registrantContact().organizationName()); } catch (Route53Exception e) { System.err.println(e.getMessage()); System.exit(1); } }
  • 有关 API 的详细信息,请参阅 AWS SDK for Java 2.x API 参考GetDomainDetail中的。

Kotlin
适用于 Kotlin 的 SDK
注意

还有更多相关信息 GitHub。查找完整示例,学习如何在 AWS 代码示例存储库中进行设置和运行。

suspend fun getDomainDetails(domainSuggestion: String?) { val detailRequest = GetDomainDetailRequest { domainName = domainSuggestion } Route53DomainsClient { region = "us-east-1" }.use { route53DomainsClient -> val response = route53DomainsClient.getDomainDetail(detailRequest) println("The contact first name is ${response.registrantContact?.firstName}") println("The contact last name is ${response.registrantContact?.lastName}") println("The contact org name is ${response.registrantContact?.organizationName}") } }
  • 有关 API 的详细信息,请参阅适用GetDomainDetail于 K otlin 的AWS SDK API 参考

适用于 .NET 的 SDK
注意

还有更多相关信息 GitHub。查找完整示例,学习如何在 AWS 代码示例存储库中进行设置和运行。

/// <summary> /// Get details for a domain. /// </summary> /// <returns>A string with detail information about the domain.</returns> public async Task<string> GetDomainDetail(string domainName) { try { var result = await _amazonRoute53Domains.GetDomainDetailAsync( new GetDomainDetailRequest() { DomainName = domainName }); var details = $"\tDomain {domainName}:\n" + $"\tCreated on {result.CreationDate.ToShortDateString()}.\n" + $"\tAdmin contact is {result.AdminContact.Email}.\n" + $"\tAuto-renew is {result.AutoRenew}.\n"; return details; } catch (InvalidInputException) { return $"Domain {domainName} was not found in your account."; } }
  • 有关 API 的详细信息,请参阅 适用于 .NET 的 AWS SDK API 参考GetDomainDetail中的。

有关 S AWS DK 开发者指南和代码示例的完整列表,请参阅将 Route 53 与 S AWS DK 一起使用。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。