Skip to content

update_domain_nameservers

update_domain_nameservers(
    domain_name: DomainName,
    nameservers: NameserverList,
    *,
    config_overrides: Optional[Route53DomainsClientConfig] = None,
    fi_auth_key: Optional[FIAuthKey] = None,
) -> UpdateDomainNameserversResponse

This operation replaces the current set of name servers for the domain with the specified set of name servers. If you use Amazon Route 53 as your DNS service, specify the four name servers in the delegation set for the hosted zone for the domain.

If successful, this operation 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 will be notified by email.

Parameters:

  • domain_name (DomainName) –

    The name of the domain that you want to change name servers for.

  • fi_auth_key (Optional[FIAuthKey], default: None ) –

    The authorization key for .fi domains

  • nameservers (NameserverList) –

    A list of new name servers for the domain.

Raises:

  • 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 update_domain_nameservers(
    self,
    domain_name: "capo_route_53_domains.types.domain_name.DomainName",
    nameservers: "capo_route_53_domains.types.nameserver_list.NameserverList",
    *,
    config_overrides: Optional[Route53DomainsClientConfig] = None,
    fi_auth_key: Optional[
        "capo_route_53_domains.types.fi_auth_key.FIAuthKey"
    ] = None,
) -> "capo_route_53_domains.types.update_domain_nameservers_response.UpdateDomainNameserversResponse":
    """<p>This operation replaces the current set of name servers for the domain with the specified set of name servers. If you use Amazon Route 53 as your DNS service, specify the four name servers in the delegation set for the hosted zone for the domain.</p> <p>If successful, this operation 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 will be notified by email.</p>

    Args:
        domain_name: <p>The name of the domain that you want to change name servers for.</p>
        fi_auth_key: <p>The authorization key for .fi domains</p>
        nameservers: <p>A list of new name servers for the domain.</p>

    Raises:
        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.update_domain_nameservers_request.UpdateDomainNameserversRequest]",
    ) -> OperationResponse[
        "capo_route_53_domains.types.update_domain_nameservers_response.UpdateDomainNameserversResponse"
    ]:
        import capo_route_53_domains._operations.route53_domains_v20140515.update_domain_nameservers

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

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

        return capo_route_53_domains.types.update_domain_nameservers_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateDomainNameservers", redact_input=_redact_input),
    )
    input_: capo_route_53_domains.types.update_domain_nameservers_request.UpdateDomainNameserversRequest = {
        "domain_name": domain_name,
        "nameservers": nameservers,
    }
    if fi_auth_key is not None:
        input_["fi_auth_key"] = fi_auth_key

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