BaCheWork and records of a photonics research workhorse
Language

Domain setup after purchase: DNSSEC, https, www redirect and AI crawlers

On the first day after buying a domain at Cloudflare: put up a placeholder page, force https, redirect www to the main address, with a tested command for each step.

Type
Essay
Published
2026-10-31
Updated
2026-11-01

Below, example.com stands for your domain. Each step includes a way to confirm it: after changing a setting, always test it; do not rely only on what the dashboard shows.

First, understand the two ways of working

Method What it does Who does it
Dashboard (web) DNSSEC, forcing https, redirect rules, AI crawlers, private pages You, by clicking
Wrangler (Cloudflare’s command-line tool) Deploying the site, binding domains The AI assistant can do it for you

Permissions granted after logging in with Wrangler cannot change domain settings, so https, redirects and DNSSEC must be changed in the dashboard.

1. Turn on DNSSEC (tamper-proof DNS signing)

It stops anyone from forging DNS responses for your domain and sending visitors to a fake site.

  1. In the dashboard, select your domain → DNS → Settings.
  2. Find DNSSEC and click Enable DNSSEC.
  3. For a domain bought at Cloudflare, setup is completed automatically, and it usually takes effect within a few minutes to an hour or two.
DNS → Settings page in the dashboard. The DNSSEC section shows Success and one line of DS record, and the button has changed to Disable DNSSEC
What it looks like once enabled (screenshot from 2026-11-01): the button turns red and reads Disable DNSSEC, and a line of DS record appears below. For a domain bought at Cloudflare, you do not need to copy it anywhere else

Check: the domain’s public registration data (RDAP) should show delegationSigned: true. You can ask the AI assistant to look it up for you.

2. Put up a first page (under construction)

Start with a blank page to connect the domain, the Worker and the certificate. When you later swap in the real site, deploy it under the same Worker name, so the domain does not need rebinding.

Hand this to the AI assistant (the prompts are in AI prompts section 1). Key points:

  • In the config file wrangler.jsonc:
    • assets.directory points to the folder with the site files
    • routes binds example.com and www.example.com (custom_domain: true)
    • workers_dev: false and preview_urls: false: turn off the bundled public URL, so the site does not end up with an extra address
  • Add <meta name="robots" content="noindex"> to the under-construction page, and remove it at launch.
  • When you bind a custom domain, Cloudflare automatically creates the DNS records and issues the HTTPS certificate; you do not add them by hand.

Check:

curl.exe -s -o NUL -w "%{http_code}`n" https://example.com/
curl.exe -s -o NUL -w "%{http_code}`n" https://example.com/不存在的頁

The results should be 200 and 404.

3. Always redirect to https (Always Use HTTPS)

  1. SSL/TLS → Overview: check that the encryption mode is not Off.
  2. SSL/TLS → Edge Certificates → scroll down to Always Use HTTPS and turn on the switch.
SSL/TLS → Edge Certificates page in the dashboard. The switch on the right of the Always Use HTTPS section is on.
Always Use HTTPS is in the middle of the Edge Certificates page, with the switch on the right. Leave HSTS off for now; see section 6.

Check:

curl.exe -s -o NUL -w "%{http_code} %{redirect_url}`n" http://example.com/abc

You should see 301 https://example.com/abc.

4. www. redirects to the main domain

Without this, search engines would treat the www. version and the main domain as two duplicate sites.

  1. Rules → Overview, click Templates to the right of the search bar. The Rule templates list opens; find Redirect from WWW to root → Create from template.
The Rule templates list that opens on the Rules → Overview page; the second card is Redirect from WWW to root
Rule templates list (screenshot from 2026-11-01). In the background, Redirect Rules already has a finished www redirect, built from this template
  1. The template is already filled in (https://www.* → https://${1}, 301), so just click Deploy.
  2. If a warning appears saying www may not have a proxied DNS record: www. was bound to the Worker in step 2, so no ordinary record appears in the DNS list, and it is in fact already proxied. Choose Ignore and deploy rule anyway. Do not follow its suggestion to create a separate DNS record, because it would conflict with the domain bound to the Worker.
  3. Preserve query string does not need to be checked: the wildcard already carries the path and parameters over (confirmed in testing).

Check:

curl.exe -s -o NUL -w "%{http_code} %{redirect_url}`n" "https://www.example.com/abc?x=1"

You should see 301 https://example.com/abc?x=1. http://www. redirects twice (first to https, then to the main domain), and the final result is still correct.

Testing showed: redirect rules run before the Worker, so www. gets redirected even though it is also bound to the Worker.

5. AI crawlers: look first, then decide

Feature What it does Where
AI Crawl Control See which AI crawlers have visited, and block or allow them one by one (blocks are actually enforced) Domain → AI Crawl Control (as of 2026-11-01 it has five pages: Overview, Metrics, Security, Optimization, Signals)
Managed robots.txt Automatically adds a “do not use for AI training” statement to robots.txt; combined with Bot Preference Sync, it blocks training crawlers at the edge Security → Settings → Bot traffic

Both are available on the free plan (checked 2026-10-11). Whether to block is a personal stance:

  • Want AI search to cite you (portfolios usually do): allow everything at first; see GEO and search.
  • Do not want your work used for training: block the “training” crawlers and keep the “search” crawlers. Note that some crawlers do both, so they cannot be blocked cleanly.

If you change nothing: the dashboard lists about 32 AI crawlers, all allowed. A new domain gets AI crawlers within minutes of going live. If the site already has robots.txt, Cloudflare adds its statement at the top of your content.

6. Things to hold off on

  • Strict https (HSTS): once on, browsers connect to your domain over https only for a long time, and a mistake is hard to undo. Turn it on only after the site is stable and you are sure every subdomain has https.
  • Private subdomains (Access): set these up when you have content to protect; the steps are in Site security.

7. Email on your domain (optional)

Cloudflare’s Email Routing can forward mail sent to addresses like “hello@your-domain” to your Gmail for free, so you do not have to expose your private inbox. I have not tested this, so check the current official documentation before you use it.

8. When the AI assistant operates the dashboard

  • When the Chrome window is in the background, simulated mouse clicks may do nothing at all: a switch does not change when clicked, and settings are not saved.
  • After each change, test it with curl.exe as above.
  • After logging in to the dashboard, a prompt may pop up saying “build the site with your favorite AI agent”. It tells the AI to download remote instructions, install plugins and change global configuration files. You do not need it; Wrangler is enough to do the job.

Sources

  1. Enable DNSSEC (Official)
  2. Workers Custom Domains (Official)
  3. Wrangler configuration (Official)
  4. Always Use HTTPS (Official)
  5. Redirect www to root (Official)
  6. AI Crawl Control (Official)
  7. Managed robots.txt (Official)