Account custom nameservers
Account custom nameservers (ACNS) allow you to define account-level custom nameservers and use them for different zones within a Cloudflare account.
ACNS are organized in different sets (ns_set
) and ACNS names can be provided by any domain, even if the domain does not exist as a zone in Cloudflare.
For instance, if the ACNS are ns1.example.com
and ns2.vanity.org
, the domains example.com
and vanity.org
are not required to be zones in Cloudflare.
Configuration conditions
For this configuration to be possible, a few conditions apply:
- You can create up to five different account custom nameserver sets. Each nameserver set must have between two and five different nameserver names (
ns_name
), and each name cannot belong to more than one set. For example, ifns1.example.com
is part ofns_set 1
it cannot be part ofns_set 2
or vice versa. - Subdomain setup or reverse zones can use account custom nameservers as long as they use a different nameserver set (
ns_set
) than their parent, child, or any other zone in their direct hierarchy tree.
Enable account custom nameservers
1. Set up ACNS names and sets
- Use the Add account custom nameserver endpoint to create account custom nameservers. Follow the conditions for
ns_name
andns_set
.
Cloudflare will assign an IPv4 and an IPv6 address to each ACNS name.
Make sure
A/AAAA
records with the assigned IPv4 and IPv6 exist at the authoritative DNS of the domain that provides the ACNS names.If the domain uses Cloudflare DNS, the respective
A
andAAAA
records are automatically created.If the domain or domains that are used for the account custom nameservers do not exist within the same account, you must manually create the
A/AAAA
records on the configured nameserver names (for example,ns1.example.com
) at the authoritative DNS provider.
Type Name Content A
ns1.example.com
<IPv4>
Update the registrar of the domain that provides the ACNS names. This step depends on whether you are using Cloudflare Registrar:
If you are using Cloudflare Registrar for the domain that provides the ACNS names, contact Cloudflare Support to add the account custom nameservers and IP addresses as glue records to the domain.
If you are not using Cloudflare Registrar for the domain that provides the ACNS names, add the account custom nameservers and IP addresses to your domain’s registrar as glue records. If you do not add these records, DNS lookups for your domain will fail.
2. Use ACNS on existing zones
Choose an ACNS set as custom nameservers for a zone. Use the Set ACNS Related Zone Metadata endpoint for each zone.
Make sure the nameservers are updated:
- If your domain uses Cloudflare Registrar, contact Cloudflare Support to update your nameservers.
- If your domain uses a different registrar or if it has been delegated to a parent domain, manually update your nameservers. Refer to Update nameservers for detailed guidance.
3. (Optional) Make ACNS default for new zones
To make these ACNS the default nameservers for all new zones added to your account from now on, use the Update Account endpoint and set the value of default_nameservers
to custom.account
.
Disable account custom nameservers
1. Remove ACNS assignment from zones
To remove ACNS from a zone, first update your nameservers to stop using ACNS:
- If you are using Cloudflare Registrar, use the Set ACNS Related Zone Metadata endpoint to change the
enabled
parameter tofalse
, and then contact Cloudflare Support to set your nameservers back to the regular Cloudflare-branded nameservers. - If you are not using Cloudflare Registrar, modify the domain’s registrar to use your regular Cloudflare-branded nameservers and then use the Set ACNS Related Zone Metadata endpoint to set the
enabled
parameter tofalse
.
2. Delete ACNS names or sets
Use the Delete account custom nameserver endpoint to delete a specific ACNS.