Use CheckDomainTransferability with an AWS SDK or CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use CheckDomainTransferability with an AWS SDK or CLI

The following code examples show how to use CheckDomainTransferability.

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> /// Check the transferability of a domain name. /// </summary> /// <param name="domain">The domain to check for transferability.</param> /// <returns>A transferability result string.</returns> public async Task<string> CheckDomainTransferability(string domain) { var result = await _amazonRoute53Domains.CheckDomainTransferabilityAsync( new CheckDomainTransferabilityRequest { DomainName = domain } ); return result.Transferability.Transferable.Value; }
CLI
AWS CLI

To determine whether a domain can be transferred to Route 53

The following check-domain-transferability command returns information about whether you can transfer the domain name example.com to Route 53.

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 check-domain-transferability \ --region us-east-1 \ --domain-name example.com

Output:

{ "Transferability": { "Transferable": "UNTRANSFERABLE" } }

For more information, see Transferring Registration for a Domain to Amazon Route 53 in the Amazon Route 53 Developer Guide.

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 checkDomainTransferability(Route53DomainsClient route53DomainsClient, String domainSuggestion) { try { CheckDomainTransferabilityRequest transferabilityRequest = CheckDomainTransferabilityRequest.builder() .domainName(domainSuggestion) .build(); CheckDomainTransferabilityResponse response = route53DomainsClient .checkDomainTransferability(transferabilityRequest); System.out.println("Transferability: " + response.transferability().transferable().toString()); } catch (Route53Exception e) { System.err.println(e.getMessage()); System.exit(1); } }
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 checkDomainTransferability(domainSuggestion: String?) { val transferabilityRequest = CheckDomainTransferabilityRequest { domainName = domainSuggestion } Route53DomainsClient { region = "us-east-1" }.use { route53DomainsClient -> val response = route53DomainsClient.checkDomainTransferability(transferabilityRequest) println("Transferability: ${response.transferability?.transferable}") } }