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.test, the domains example.com and vanity.test are not required to be zones in Cloudflare.
Account custom nameservers are available for customers on Business (after contacting Cloudflare Support) or Enterprise plans. Once configured, account custom nameservers can be used by all zones in the account, regardless of the zone plan. Via API or on the dashboard.
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.comis part ofns_set 1it cannot be part ofns_set 2or 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.
- Choosing a set from
ns_set 1throughns_set 5will influence how Cloudflare assigns nameservers to your new zones if you configure DNS zone defaults.
- Create ACNS names and sets:
-
In the Cloudflare dashboard, go to the account Settings page.
Go to Configurations ↗ -
Go to DNS Settings.
-
For Account custom nameservers, select Configure custom nameservers.
-
Insert a fully qualified domain name for Nameserver name and choose a Nameserver set. Follow the configuration conditions.
Use the Add account custom nameserver endpoint to create account custom nameservers. Follow the conditions for ns_name and ns_set.
Cloudflare will assign an IPv4 and an IPv6 address to each ACNS name, and these nameservers will be listed as options that you can use on existing zones or set up as default for new zones in the account.
- Make sure
A/AAAArecords 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
AandAAAArecords 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/AAAArecords 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 (RFC 1912 ↗). If you do not add these records, DNS lookups for your domain will fail.
-
- Choose an ACNS set as custom nameservers for a zone:
-
In the Cloudflare dashboard, go to the DNS Records page.
Go to Records ↗ -
For Custom nameservers, select Configure.
-
Select Use your account custom nameservers and choose a nameserver set from the list.
-
Select Save to confirm.
Use the endpoint Update DNS Settings for a Zone and configure the nameservers object accordingly 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, update the nameservers at your registrar to use the account custom nameservers.
- If your zone is delegated, update the corresponding
NSrecord at the parent zone.
To make ACNS the default option for all new zones added to your account from now on:
-
In the Cloudflare dashboard, go to the account Settings page.
Go to Configurations ↗ -
Go to DNS Settings.
-
For DNS zone defaults, select Configure defaults.
-
Change the Nameserver assignment method to Account custom nameservers.
Refer to DNS zone defaults for details.
Use the endpoint Update DNS Settings for an Account. Within the zone_defaults object, set the following:
"zone_defaults": {
"nameservers": {
"type": "custom.account"
}
}To remove ACNS from a zone, first update your nameservers to stop using ACNS:
- If you are using Cloudflare Registrar, 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.
- If you are using Cloudflare Registrar, use the Update DNS settings endpoint to set the
typeparameter in thenameserversobject to"cloudflare.standard". 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 Update DNS settings endpoint to set the
typeparameter in thenameserversobject to"cloudflare.standard".
Following the configuration conditions, each set must have between two and five different nameserver names. When you delete all names or leave a set with only one nameserver name, the set will no longer be listed as an option for the zones in your account.
-
In the Cloudflare dashboard, go to the account Settings page.
Go to Configurations ↗ -
Go to DNS Settings.
-
For Account custom nameservers, select Delete next to the ACNS name.
Use the Delete account custom nameserver endpoint to delete a specific ACNS.