Pular para o conteúdo

Set up advanced nameservers

Atualizado em Ver como Markdown

Advanced nameservers included with Foundation DNS are an opt-in configuration.

Before you begin

Before opting in for advanced nameservers, consider the following:

Differences from standard nameservers

Some behaviors are different from standard Cloudflare nameservers:

  • Wildcard records are still supported but, with advanced nameservers, a wildcard record (*.example.com) will not apply to a subdomain that is an empty non-terminal. An empty non-terminal is a node in the DNS tree that has no records associated with it but has descendants that do, as exemplified below. This behavior is in compliance with RFC 4592, which defines the role of empty non-terminals in wildcard resolution.

Example

DNS management for example.com

Type Name Content
A * 192.0.2.1
A a.b 192.0.2.5

In this example, a.b.example.com is a descendant of b.example.com, and b.example.com is an empty non-terminal. This means that the wildcard *.example.com will not apply to b.example.com.

  • Subdomain delegation: once a subdomain is delegated via NS records, Cloudflare will not serve any other records (such as A, TXT, or CNAME) on that subdomain from the parent zone, even if those records exist.

Example

DNS management for example.com

Type Name Content
NS www ns1.externalhost.com
NS www ns2.externalhost.com
TXT www "5bb16e6b5a444eedb48ace40c471bcc9"
A www 192.0.2.1

In this example, the TXT record and the A record for www.example.com will not be served.

Enable on a zone

To enable advanced nameservers on an existing zone:

  1. Opt for advanced nameservers on your zone:

    1. In the Cloudflare dashboard, go to the DNS Records page.

      Go to Records ↗
    2. In the Cloudflare nameservers card, enable Advanced nameservers.

    3. After you refresh the page, the card will display the values for your advanced nameservers NS records.

    Use the Update DNS Settings endpoint to send a PATCH request like the following:

    Required API token permissions

    At least one of the following token permissions is required:
    • Zone DNS Settings Write
    • DNS Write
    Update DNS Settingsbash
    curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_settings" \
    	--request PATCH \
    	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    	--json '{
    		"foundation_dns": true
    	}'

    The response body will contain your assigned nameservers in the nameservers object. You will use these nameservers in the next step.

  2. Update the authoritative nameservers at your registrar. This step depends on whether you are using Cloudflare Registrar: