Use GetDomainDetail with an AWS SDK or CLI - Amazon Route 53

Use GetDomainDetail with an AWS 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
AWS SDK for .NET
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS 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."; } }
CLI
AWS 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 AWS 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 AWS 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 AWS 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 AWS SDK for Kotlin API reference.

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