INTEGRITY Cloudflare Docs

Set up a primary zone (Full setup)

Cloudflare DNS offers a few different setup options. A primary setup (also known as full) is the most common and the only one available for Free or Pro plans. For details, refer to About. For more introductory context, refer to Concepts.

Before you begin

Make sure that you:

1. Add your domain to Cloudflare

  1. Log in to the Cloudflare dashboard.

    Go to Domains ↗
  2. Select Onboard a domain.

  3. Enter your apex domain (for example, example.com) and choose how you would like to add your DNS records.

  4. Select Continue and choose a plan.

Required API token permissions

At least one of the following token permissions is required:
  • Zone Zone Edit
  • Zone DNS Edit
Create Zone
curl "https://api.cloudflare.com/client/v4/zones" \
	--request POST \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
	--json '{
		"name": "<YOUR_DOMAIN>",
		"account": {
				"id": "<YOUR_ACCOUNT_ID>"
		}
	}'

DNS records quick scan

Cloudflare can automatically scan for your records and add them to the DNS zone for you, or you can add records manually. These records show up under your domain on the DNS Records page of the dashboard.

2. Review your DNS records

Your DNS records must be accurate for your domain to work properly. If you don't know what DNS records are, consider the video below for a quick explanation.

Common records

Since the quick scan is not guaranteed to find all existing DNS records, you need to review your records, paying special attention to the following:

Proxy status

Each A, AAAA, and CNAME record has a proxy status toggle:

3. Change your nameservers

Your domain will be assigned two authoritative Cloudflare nameservers. Nameservers are specialized servers that store your domain's DNS records and "answer" requests from browsers by providing the specific IP address needed to connect to your website.

3.1. Get nameserver names

Your assigned nameservers are displayed as part of the onboarding flow. If you need to find them once again, go the zone Overview page.

Go to Overview ↗

Required API token permissions

At least one of the following token permissions is required:
  • Trust and Safety Write
  • Trust and Safety Read
  • Zero Trust: PII Read
  • Zaraz Edit
  • Zaraz Read
  • Zaraz Admin
  • Access: Apps and Policies Revoke
  • Access: Apps and Policies Write
  • Access: Apps and Policies Read
  • Access: Apps and Policies Revoke
  • Access: Mutual TLS Certificates Write
  • Access: Organizations, Identity Providers, and Groups Write
  • Zone Settings Write
  • Zone Settings Read
  • Zone Read
  • DNS Read
  • Workers Scripts Write
  • Workers Scripts Read
  • Zone Write
  • Workers Routes Write
  • Workers Routes Read
  • Stream Write
  • Stream Read
  • SSL and Certificates Write
  • SSL and Certificates Read
  • Logs Write
  • Logs Read
  • Cache Purge
  • Page Rules Write
  • Page Rules Read
  • Load Balancers Write
  • Load Balancers Read
  • Firewall Services Write
  • Firewall Services Read
  • DNS Write
  • Apps Write
  • Analytics Read
  • Access: Apps and Policies Write
  • Access: Apps and Policies Read
Zone Details
curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID" \
	--request GET \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"

3.2. Log in to your registrar

Log in to the admin account for your domain registrar. If you do not know your provider, use ICANN Lookup.

3.3. Turn off DNSSEC

If your domain has DNSSEC1 active, you must turn it off at your registrar before replacing nameservers. Changing nameservers while DNSSEC is active can cause your domain to become unreachable. You can re-enable DNSSEC through Cloudflare after your domain is active.

Provider-specific DNSSEC instructions

This is not an exhaustive list, but the following links may be helpful:

3.4. Update your registrar

  1. Remove your existing authoritative nameservers.

  2. Add the nameservers provided by Cloudflare. If their names are not copied exactly, your DNS will not resolve correctly.

Provider-specific instructions

This is not an exhaustive list of provider-specific instructions, but the following links may be helpful:

To avoid common issues, refer to our Nameserver replacement checklist.

3.5. Verify changes

Wait up to 24 hours while your registrar updates your nameservers.

When your domain is Active:

*macOS/Linux*

whois <DOMAIN_NAME>
dig ns <DOMAIN_NAME> @1.1.1.1
dig ns <DOMAIN_NAME> @8.8.8.8
dig <DOMAIN_NAME> +trace

*Windows*

nslookup -type=ns <DOMAIN_NAME> 1.1.1.1
nslookup -type=ns <DOMAIN_NAME> 8.8.8.8

4. Re-enable DNSSEC

If you turned off DNSSEC before updating your nameservers, you can now re-enable DNSSEC through Cloudflare to protect your domain from spoofing.

Footnotes

  1. A security feature that protects DNS records from spoofing