Use GetDomainDetail with an Amazon SDK or CLI - Amazon Route 53
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Use GetDomainDetail with an Amazon SDK or CLI

The following code examples show how to use GetDomainDetail.

Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:

.NET
Amazon SDK for .NET
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

/// <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."; } }
  • For API details, see GetDomainDetail in Amazon SDK for .NET API Reference.

CLI
Amazon CLI

To get detailed information about a specified domain

The following get-domain-detail command displays detailed information about the specified domain.

This command runs only in the us-east-1 Region. If your default region is set to us-east-1, you can omit the region parameter.

aws route53domains get-domain-detail \ --region us-east-1 \ --domain-name example.com

Output:

{ "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" ] }
Java
SDK for Java 2.x
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

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); } }
  • For API details, see GetDomainDetail in Amazon SDK for Java 2.x API Reference.

Kotlin
SDK for Kotlin
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the Amazon Code Examples Repository.

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}") } }
  • For API details, see GetDomainDetail in Amazon SDK for Kotlin API reference.

For a complete list of Amazon SDK developer guides and code examples, see Using Route 53 with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.