registerDomain method
- required ContactDetail adminContact,
- required String domainName,
- required int durationInYears,
- required ContactDetail registrantContact,
- required ContactDetail techContact,
- bool? autoRenew,
- ContactDetail? billingContact,
- String? idnLangCode,
- bool? privacyProtectAdminContact,
- bool? privacyProtectBillingContact,
- bool? privacyProtectRegistrantContact,
- bool? privacyProtectTechContact,
This operation registers a domain. For some top-level domains (TLDs), this operation requires extra parameters.
When you register a domain, Amazon Route 53 does the following:
- Creates a Route 53 hosted zone that has the same name as the domain. Route 53 assigns four name servers to your hosted zone and automatically updates your domain registration with the names of these name servers.
- Enables auto renew, so your domain registration will renew automatically each year. We'll notify you in advance of the renewal date so you can choose whether to renew the registration.
- Optionally enables privacy protection, so WHOIS queries return contact for the registrar or the phrase "REDACTED FOR PRIVACY", or "On behalf of
- If registration is successful, returns an operation ID that you can use to track the progress and completion of the action. If the request is not completed successfully, the domain registrant is notified by email.
- Charges your Amazon Web Services account an amount based on the top-level domain. For more information, see Amazon Route 53 Pricing.
May throw DomainLimitExceeded.
May throw DuplicateRequest.
May throw InvalidInput.
May throw OperationLimitExceeded.
May throw TLDRulesViolation.
May throw UnsupportedTLD.
Parameter adminContact :
Provides detailed contact information. For information about the values
that you specify for each element, see ContactDetail.
Parameter domainName :
The domain name that you want to register. The top-level domain (TLD),
such as .com, must be a TLD that Route 53 supports. For a list of
supported TLDs, see Domains
that You Can Register with Amazon Route 53 in the Amazon Route 53
Developer Guide.
The domain name can contain only the following characters:
- Letters a through z. Domain names are not case sensitive.
- Numbers 0 through 9.
- Hyphen (-). You can't specify a hyphen at the beginning or end of a label.
-
Period (.) to separate the labels in the name, such as the
.inexample.com.
Parameter durationInYears :
The number of years that you want to register the domain for. Domains are
registered for a minimum of one year. The maximum period depends on the
top-level domain. For the range of valid values for your domain, see Domains
that You Can Register with Amazon Route 53 in the Amazon Route 53
Developer Guide.
Default: 1
Parameter registrantContact :
Provides detailed contact information. For information about the values
that you specify for each element, see ContactDetail.
Parameter techContact :
Provides detailed contact information. For information about the values
that you specify for each element, see ContactDetail.
Parameter autoRenew :
Indicates whether the domain will be automatically renewed
(true) or not (false). Auto renewal only takes
effect after the account is charged.
Default: true
Parameter billingContact :
Provides detailed contact information. For information about the values
that you specify for each element, see ContactDetail.
Parameter idnLangCode :
Reserved for future use.
Parameter privacyProtectAdminContact :
Whether you want to conceal contact information from WHOIS queries. If you
specify true, WHOIS ("who is") queries return contact
information either for Amazon Registrar or for our registrar associate,
Gandi. If you specify false, WHOIS queries return the
information that you entered for the admin contact.
Default: true
Parameter privacyProtectBillingContact :
Whether you want to conceal contact information from WHOIS queries. If you
specify true, WHOIS ("who is") queries return contact
information either for Amazon Registrar or for our registrar associate,
Gandi. If you specify false, WHOIS queries return the
information that you entered for the billing contact.
Parameter privacyProtectRegistrantContact :
Whether you want to conceal contact information from WHOIS queries. If you
specify true, WHOIS ("who is") queries return contact
information either for Amazon Registrar or for our registrar associate,
Gandi. If you specify false, WHOIS queries return the
information that you entered for the registrant contact (the domain
owner).
Default: true
Parameter privacyProtectTechContact :
Whether you want to conceal contact information from WHOIS queries. If you
specify true, WHOIS ("who is") queries return contact
information either for Amazon Registrar or for our registrar associate,
Gandi. If you specify false, WHOIS queries return the
information that you entered for the technical contact.
Default: true
Implementation
Future<RegisterDomainResponse> registerDomain({
required ContactDetail adminContact,
required String domainName,
required int durationInYears,
required ContactDetail registrantContact,
required ContactDetail techContact,
bool? autoRenew,
ContactDetail? billingContact,
String? idnLangCode,
bool? privacyProtectAdminContact,
bool? privacyProtectBillingContact,
bool? privacyProtectRegistrantContact,
bool? privacyProtectTechContact,
}) async {
_s.validateNumRange(
'durationInYears',
durationInYears,
1,
10,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Route53Domains_v20140515.RegisterDomain'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AdminContact': adminContact,
'DomainName': domainName,
'DurationInYears': durationInYears,
'RegistrantContact': registrantContact,
'TechContact': techContact,
if (autoRenew != null) 'AutoRenew': autoRenew,
if (billingContact != null) 'BillingContact': billingContact,
if (idnLangCode != null) 'IdnLangCode': idnLangCode,
if (privacyProtectAdminContact != null)
'PrivacyProtectAdminContact': privacyProtectAdminContact,
if (privacyProtectBillingContact != null)
'PrivacyProtectBillingContact': privacyProtectBillingContact,
if (privacyProtectRegistrantContact != null)
'PrivacyProtectRegistrantContact': privacyProtectRegistrantContact,
if (privacyProtectTechContact != null)
'PrivacyProtectTechContact': privacyProtectTechContact,
},
);
return RegisterDomainResponse.fromJson(jsonResponse.body);
}