Skip to content

register_domain

register_domain(
    domain_name: DomainName,
    duration_in_years: DurationInYears,
    admin_contact: ContactDetail,
    registrant_contact: ContactDetail,
    tech_contact: ContactDetail,
    *,
    config_overrides: Optional[Route53DomainsClientConfig] = None,
    idn_lang_code: Optional[LangCode] = None,
    auto_renew: Optional[Boolean] = None,
    privacy_protect_admin_contact: Optional[Boolean] = None,
    privacy_protect_registrant_contact: Optional[Boolean] = None,
    privacy_protect_tech_contact: Optional[Boolean] = None,
    billing_contact: Optional[ContactDetail] = None,
    privacy_protect_billing_contact: Optional[Boolean] = None,
    consent: Optional[Consent] = None,
) -> RegisterDomainResponse

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 owner." If you don't enable privacy protection, WHOIS queries return the information that you entered for the administrative, registrant, and technical contacts.

    While some domains may allow different privacy settings per contact, we recommend specifying the same privacy setting for all contacts.

  • 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.

Parameters:

  • domain_name (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 . in example.com.

    Internationalized domain names are not supported for some top-level domains. To determine whether the TLD that you want to use supports internationalized domain names, see Domains that You Can Register with Amazon Route 53. For more information, see Formatting Internationalized Domain Names.

  • idn_lang_code (Optional[LangCode], default: None ) –

    Reserved for future use.

  • duration_in_years (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

  • auto_renew (Optional[Boolean], default: None ) –

    Indicates whether the domain will be automatically renewed (true) or not (false). Auto renewal only takes effect after the account is charged.

    Default: true

  • admin_contact (ContactDetail) –

    Provides detailed contact information. For information about the values that you specify for each element, see ContactDetail.

  • registrant_contact (ContactDetail) –

    Provides detailed contact information. For information about the values that you specify for each element, see ContactDetail.

  • tech_contact (ContactDetail) –

    Provides detailed contact information. For information about the values that you specify for each element, see ContactDetail.

  • privacy_protect_admin_contact (Optional[Boolean], default: None ) –

    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.

    You must specify the same privacy setting for the administrative, billing, registrant, and technical contacts.

    Default: true

  • privacy_protect_registrant_contact (Optional[Boolean], default: None ) –

    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).

    You must specify the same privacy setting for the administrative, billing, registrant, and technical contacts.

    Default: true

  • privacy_protect_tech_contact (Optional[Boolean], default: None ) –

    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.

    You must specify the same privacy setting for the administrative, billing, registrant, and technical contacts.

    Default: true

  • billing_contact (Optional[ContactDetail], default: None ) –

    Provides detailed contact information. For information about the values that you specify for each element, see ContactDetail.

  • privacy_protect_billing_contact (Optional[Boolean], default: None ) –

    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.

    You must specify the same privacy setting for the administrative, billing, registrant, and technical contacts.

  • consent (Optional[Consent], default: None ) –

    Specifies the maximum price that you agree to pay to register the domain name. This element is required if the domain has registry premium pricing, and optional if the domain is priced at the standard rate for its TLD. If you include it and the registration price is more than MaxPrice, the request fails.

Raises:

  • DomainLimitExceeded –

    The number of domains has exceeded the allowed threshold for the account.

  • DuplicateRequest –

    The request is already in progress for the domain.

  • InvalidInput –

    The requested item is not acceptable. For example, for APIs that accept a domain name, the request might specify a domain name that doesn't belong to the account that submitted the request. For AcceptDomainTransferFromAnotherAwsAccount, the password might be invalid.

  • OperationLimitExceeded –

    The number of operations or jobs running exceeded the allowed threshold for the account.

  • TLDRulesViolation –

    The top-level domain does not support this operation.

  • UnsupportedTLD –

    Amazon Route 53 does not support this top-level domain (TLD).

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_route_53_domains/_services/route53_domains.py
def register_domain(
    self,
    domain_name: "capo_route_53_domains.types.domain_name.DomainName",
    duration_in_years: "capo_route_53_domains.types.duration_in_years.DurationInYears",
    admin_contact: "capo_route_53_domains.types.contact_detail.ContactDetail",
    registrant_contact: "capo_route_53_domains.types.contact_detail.ContactDetail",
    tech_contact: "capo_route_53_domains.types.contact_detail.ContactDetail",
    *,
    config_overrides: Optional[Route53DomainsClientConfig] = None,
    idn_lang_code: Optional[
        "capo_route_53_domains.types.lang_code.LangCode"
    ] = None,
    auto_renew: Optional["capo_route_53_domains.types.boolean.Boolean"] = None,
    privacy_protect_admin_contact: Optional[
        "capo_route_53_domains.types.boolean.Boolean"
    ] = None,
    privacy_protect_registrant_contact: Optional[
        "capo_route_53_domains.types.boolean.Boolean"
    ] = None,
    privacy_protect_tech_contact: Optional[
        "capo_route_53_domains.types.boolean.Boolean"
    ] = None,
    billing_contact: Optional[
        "capo_route_53_domains.types.contact_detail.ContactDetail"
    ] = None,
    privacy_protect_billing_contact: Optional[
        "capo_route_53_domains.types.boolean.Boolean"
    ] = None,
    consent: Optional["capo_route_53_domains.types.consent.Consent"] = None,
) -> "capo_route_53_domains.types.register_domain_response.RegisterDomainResponse":
    """<p>This operation registers a domain. For some top-level domains (TLDs), this operation requires extra parameters.</p> <p>When you register a domain, Amazon Route 53 does the following:</p> <ul> <li> <p>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.</p> </li> <li> <p>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.</p> </li> <li> <p>Optionally enables privacy protection, so WHOIS queries return contact for the registrar or the phrase "REDACTED FOR PRIVACY", or "On behalf of <domain name> owner." If you don't enable privacy protection, WHOIS queries return the information that you entered for the administrative, registrant, and technical contacts.</p> <note> <p>While some domains may allow different privacy settings per contact, we recommend specifying the same privacy setting for all contacts.</p> </note> </li> <li> <p>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.</p> </li> <li> <p>Charges your Amazon Web Services account an amount based on the top-level domain. For more information, see <a href="http://aws.amazon.com/route53/pricing/">Amazon Route 53 Pricing</a>.</p> </li> </ul>

    Args:
        domain_name: <p>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 <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html">Domains that You Can Register with Amazon Route 53</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> <p>The domain name can contain only the following characters:</p> <ul> <li> <p>Letters a through z. Domain names are not case sensitive.</p> </li> <li> <p>Numbers 0 through 9.</p> </li> <li> <p>Hyphen (-). You can't specify a hyphen at the beginning or end of a label. </p> </li> <li> <p>Period (.) to separate the labels in the name, such as the <code>.</code> in <code>example.com</code>.</p> </li> </ul> <p>Internationalized domain names are not supported for some top-level domains. To determine whether the TLD that you want to use supports internationalized domain names, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html">Domains that You Can Register with Amazon Route 53</a>. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html#domain-name-format-idns">Formatting Internationalized Domain Names</a>. </p>
        idn_lang_code: <p>Reserved for future use.</p>
        duration_in_years: <p>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 <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/registrar-tld-list.html">Domains that You Can Register with Amazon Route 53</a> in the <i>Amazon Route 53 Developer Guide</i>.</p> <p>Default: 1</p>
        auto_renew: <p>Indicates whether the domain will be automatically renewed (<code>true</code>) or not (<code>false</code>). Auto renewal only takes effect after the account is charged.</p> <p>Default: <code>true</code> </p>
        admin_contact: <p>Provides detailed contact information. For information about the values that you specify for each element, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_ContactDetail.html">ContactDetail</a>.</p>
        registrant_contact: <p>Provides detailed contact information. For information about the values that you specify for each element, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_ContactDetail.html">ContactDetail</a>.</p>
        tech_contact: <p>Provides detailed contact information. For information about the values that you specify for each element, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_ContactDetail.html">ContactDetail</a>.</p>
        privacy_protect_admin_contact: <p>Whether you want to conceal contact information from WHOIS queries. If you specify <code>true</code>, WHOIS ("who is") queries return contact information either for Amazon Registrar or for our registrar associate, Gandi. If you specify <code>false</code>, WHOIS queries return the information that you entered for the admin contact.</p> <note> <p>You must specify the same privacy setting for the administrative, billing, registrant, and technical contacts.</p> </note> <p>Default: <code>true</code> </p>
        privacy_protect_registrant_contact: <p>Whether you want to conceal contact information from WHOIS queries. If you specify <code>true</code>, WHOIS ("who is") queries return contact information either for Amazon Registrar or for our registrar associate, Gandi. If you specify <code>false</code>, WHOIS queries return the information that you entered for the registrant contact (the domain owner).</p> <note> <p>You must specify the same privacy setting for the administrative, billing, registrant, and technical contacts.</p> </note> <p>Default: <code>true</code> </p>
        privacy_protect_tech_contact: <p>Whether you want to conceal contact information from WHOIS queries. If you specify <code>true</code>, WHOIS ("who is") queries return contact information either for Amazon Registrar or for our registrar associate, Gandi. If you specify <code>false</code>, WHOIS queries return the information that you entered for the technical contact.</p> <note> <p>You must specify the same privacy setting for the administrative, billing, registrant, and technical contacts.</p> </note> <p>Default: <code>true</code> </p>
        billing_contact: <p>Provides detailed contact information. For information about the values that you specify for each element, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_ContactDetail.html">ContactDetail</a>.</p>
        privacy_protect_billing_contact: <p>Whether you want to conceal contact information from WHOIS queries. If you specify <code>true</code>, WHOIS ("who is") queries return contact information either for Amazon Registrar or for our registrar associate, Gandi. If you specify <code>false</code>, WHOIS queries return the information that you entered for the billing contact.</p> <note> <p>You must specify the same privacy setting for the administrative, billing, registrant, and technical contacts.</p> </note>
        consent: <p>Specifies the maximum price that you agree to pay to register the domain name. This element is required if the domain has registry premium pricing, and optional if the domain is priced at the standard rate for its TLD. If you include it and the registration price is more than <code>MaxPrice</code>, the request fails.</p>

    Raises:
        capo_route_53_domains.errors.domain_limit_exceeded.DomainLimitExceeded: <p>The number of domains has exceeded the allowed threshold for the account.</p>
        capo_route_53_domains.errors.duplicate_request.DuplicateRequest: <p>The request is already in progress for the domain.</p>
        capo_route_53_domains.errors.invalid_input.InvalidInput: <p>The requested item is not acceptable. For example, for APIs that accept a domain name, the request might specify a domain name that doesn't belong to the account that submitted the request. For <code>AcceptDomainTransferFromAnotherAwsAccount</code>, the password might be invalid.</p>
        capo_route_53_domains.errors.operation_limit_exceeded.OperationLimitExceeded: <p>The number of operations or jobs running exceeded the allowed threshold for the account.</p>
        capo_route_53_domains.errors.tld_rules_violation.TLDRulesViolation: <p>The top-level domain does not support this operation.</p>
        capo_route_53_domains.errors.unsupported_tld.UnsupportedTLD: <p>Amazon Route 53 does not support this top-level domain (TLD).</p>
        capo_route_53_domains.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_route_53_domains.types.register_domain_request.RegisterDomainRequest]",
    ) -> OperationResponse[
        "capo_route_53_domains.types.register_domain_response.RegisterDomainResponse"
    ]:
        import capo_route_53_domains._operations.route53_domains_v20140515.register_domain

        output, http_response = (
            capo_route_53_domains._operations.route53_domains_v20140515.register_domain.register_domain(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_route_53_domains.types.register_domain_request.RegisterDomainRequest",
    ) -> dict[str, Any]:
        import capo_route_53_domains.types.register_domain_request

        return capo_route_53_domains.types.register_domain_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("RegisterDomain", redact_input=_redact_input),
    )
    input_: capo_route_53_domains.types.register_domain_request.RegisterDomainRequest = {
        "domain_name": domain_name,
        "duration_in_years": duration_in_years,
        "admin_contact": admin_contact,
        "registrant_contact": registrant_contact,
        "tech_contact": tech_contact,
    }
    if idn_lang_code is not None:
        input_["idn_lang_code"] = idn_lang_code
    if auto_renew is not None:
        input_["auto_renew"] = auto_renew
    if privacy_protect_admin_contact is not None:
        input_["privacy_protect_admin_contact"] = privacy_protect_admin_contact
    if privacy_protect_registrant_contact is not None:
        input_["privacy_protect_registrant_contact"] = (
            privacy_protect_registrant_contact
        )
    if privacy_protect_tech_contact is not None:
        input_["privacy_protect_tech_contact"] = privacy_protect_tech_contact
    if billing_contact is not None:
        input_["billing_contact"] = billing_contact
    if privacy_protect_billing_contact is not None:
        input_["privacy_protect_billing_contact"] = privacy_protect_billing_contact
    if consent is not None:
        input_["consent"] = consent

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output