Cloudflare Docs
DNS
DNS
Visit DNS on GitHub
Set theme to dark (⇧+D)

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:

  1. If the domain or domains that are used for the account custom nameservers do not exist within the same account, you must create the A/AAAA records on the configured nameserver names (e.g. ns1.example.com) at the authoritative DNS provider.
TypeNameContent
Ans1.example.com<IPv4>
  1. 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, if ns1.example.com is part of ns_set 1 it cannot be part of ns_set 2 or vice versa.
  2. 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.

​​ Cloudflare Registrar

If you are using Cloudflare Registrar for the zone that provides the ACNS names, you have a different setup process.

​​ Add account custom nameservers

  1. Create account custom nameservers with a POST command, following the conditions for ns_name and ns_set.
  1. Contact Cloudfare Support to add glue records to your ACNS and update your nameservers.
  2. To enable the ACNS on existing zones, use a PUT command on each zone. Cloudflare will assign an IPv4 and an IPv6 address to each ACNS name and automatically create the associated A or AAAA records.

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.

​​ Remove account custom nameservers

To remove ACNS and their associated DNS records from a zone, use a PUT command.

​​ Non-Cloudflare Registrar

If you are not using Cloudflare Registrar for the zone that provides the ACNS names, you have to set the glue records yourself.

​​ Add account custom nameservers

  1. Create account custom nameservers with a POST command, following the conditions for ns_name and ns_set.
  1. Add the account custom nameservers and IP addresses to your domain’s registrar as glue (A and AAAA) records. If you do not add these records, DNS lookups for your domain will fail.

  2. To enable the ACNS on existing zones:

    1. Use a PUT command on each zone. Cloudflare will assign an IPv4 and an IPv6 address to each ACNS name and automatically create the associated A or AAAA records.
    1. Update the nameservers at the registrar to use the account custom nameserver names.

To make these ACNS the default namerservers 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.

​​ Remove account custom nameservers

To remove ACNS and their associated DNS records from a zone, modify the domain’s registrar to use your regular Cloudflare branded nameservers and then send a PUT command to the Cloudflare API.