# Domains

> Add a domain to a site, prove you own it, set its DNS records, move a live site from elsewhere, make a domain primary, remove one, and turn on Force HTTPS.

Source: https://docs.wpwaterfall.com/domains

A domain is a hostname that points at one environment of your site. Open your site, then **Domains**, to add a domain, check its DNS records, make it primary, or remove it.

The tab has two parts:

- **Primary domain** at the top: the environment name, the domain visitors use with a copy button, and the links **Visit site**, **Visit WP login**, and **Log in to WP Admin**. The last one hides when one click login is off. Until you make one of your own domains primary, the temporary domain is primary.
- **Domains list**: every domain of the environment, with search, a filter (All domains, Active, Pending, Failed), a refresh button, and a three dot menu on each row.

The first row is the temporary domain WP Waterfall assigned, marked **Temporary**. You cannot remove it or make it primary. It follows the site name. See [Your site's temporary domain](https://docs.wpwaterfall.com/temporary-domain).

## How do I add a domain?

Custom domains attach to live. A new site runs on staging only, so choose **Launch live** first. Adding a domain before that answers `live_not_launched`. A [sandbox site](https://docs.wpwaterfall.com/sandbox-sites) on an Enterprise account cannot have a custom domain at all until it goes live: adding one answers `sandbox_no_domains` and says to launch the site live first. Staging and previews can use names under a domain connected to live. See [Domains on staging and previews](https://docs.wpwaterfall.com/staging-domains).

1. Open your site, then **Domains**, and choose **Add domain**.
2. Type the domain. **Add www\. subdomain** is ticked by default, so both names are added. Type `www.example.com` and it offers `example.com` instead. Clear the box to add one name only. The box is hidden for a name such as `blog.example.com`, and off for a wildcard or a domain for one site of a network.
3. Choose the setup. **Avoid downtime** is the default (`prepare_first`): you verify the domain first, then point DNS, so visitors never see a gap. **Quick setup** (`standard`) points DNS now, and there can be a short wait for the certificate. Quick setup is unavailable for names that need TXT validation, such as a wildcard. You can change the setup of a domain after you add it.
4. Choose **Add domain**. A blue bar says the environment is disabled until the process is complete. A job that only waits for your DNS records does not hold the page.
5. **Domain verification** shows the records that verify the domain, each with copy buttons and a status of **Missing record** or **Found**. **Export all** downloads them as CSV. **I'll do it later** closes the dialog. **OK, I've done it** checks the records.
6. **Point domain** shows the record that points the domain at your site, with copy buttons and a status. Set it as DNS only, not proxied. Choose **Finish**. WP Waterfall keeps checking after you close the dialog.

**Advanced settings** at the top right of step 1 shows **Add domain with wildcard** and **Use my own SSL certificate with this domain**. Both are set up by our team, because they use Cloudflare Enterprise features. Message Nami from the chat button to turn one on. To upload a certificate with the Custom SSL add-on, see [Custom SSL](https://docs.wpwaterfall.com/custom-ssl).

Both names appear in the list. The name you typed attaches first and is the one to make primary. If the other name is already used elsewhere, WP Waterfall adds only the name you typed. To send visitors from one name to the other, make the one you typed primary and choose **Primary domain only** in the **Force HTTPS** card under **Tools**.

Each row shows **Temporary**, **Primary**, or **Wildcard** beside the name, and the state when the domain is waiting on DNS, validating, securing, or failed. An active domain shows a blue check. A domain that is not live shows **Domain not live** and **Verify domain**, which opens that domain's records. Select the name to see its DNS records.

Once the first domain on live is active, WP Waterfall sets up [Vulnerability protection](https://docs.wpwaterfall.com/vulnerability-protection) under that domain as part of the same job. A site on its temporary domain only has none yet.

## How does WP Waterfall know the domain is mine?

Before a domain gets traffic or a certificate, you prove you control it with one TXT record at your DNS host. This keeps anyone else from connecting a domain they do not own. Nothing is set up at Cloudflare, no certificate is ordered, and no route is made until the record resolves. The domain shows **Waiting for ownership record** meanwhile.

| Type | Name | Value |
| --- | --- | --- |
| TXT | `_wpwaterfall-challenge.example.com` | `wpwaterfall-domain-verify=` and a code |

- Copy the name and the value from step 2 of the dialog. Many DNS editors add your domain to the end of the name field on their own, so type only `_wpwaterfall-challenge` when yours does.
- WP Waterfall checks every minute, for up to 72 hours. The code is good for the same 72 hours. If it runs out, the domain shows **Failed**. Add the domain again to get a new code.
- Keep the record. WP Waterfall checks it again every day.
- WP Waterfall watches up to six waiting domains of your account at a time. The others start as soon as one finishes. To check a domain right away, open its menu and choose **Verify**, or call `POST /v1/domains/{id}/verify`.
- If the domain's DNS is a Cloudflare DNS zone that is active, the zone is the proof and you add no record. A zone still waiting for its nameservers is not.

Proving `example.com` also proves `www.example.com` and any name under it, such as `staging.example.com`, so you add one ownership record, not one for each. It does not work the other way round: proving `www.example.com` does not prove `example.com`. When you add both in one step, WP Waterfall proves the apex first.

## What can a Site Admin add?

A Site Admin works on some sites of an account and does not manage the account's DNS. An Owner, an Admin, and a Developer do. So the two shortcuts above, an active DNS zone and a proven parent name, work for a Site Admin only where one of their own sites already has a domain:

- A name in a DNS zone of the account is proven by the zone, and gets its records written, when a site the Site Admin belongs to already has a proven domain in that zone.
- A name under a proven domain follows that domain's site. Under a domain of their own site it needs no record. Under a domain of another site it needs the TXT record.
- Every other name takes the TXT record like a domain at an outside DNS host, and WP Waterfall writes nothing into the zone for it. Someone who manages the DNS adds the records. An Owner, an Admin, or a Developer can also approve the name by adding the same domain on the same environment themselves: WP Waterfall then proves it through the zone and writes the records.
- A wildcard such as `*.example.com` takes every name under a domain, so a Site Admin cannot add one. The answer is 403 with the code `wildcard_needs_dns_access`: "A wildcard domain covers every name under it, so only a person who can manage DNS for the whole account can add one. Ask an Owner, an Admin, or a Developer to add it."

This keeps one client's Site Admin in an agency account from putting their site on a free name of another client's domain. Nothing changes for an Owner, an Admin, or a Developer, or for an API key or an AI assistant connection of one.

## What do I add at my DNS host?

The tab lists each record with its type, name, value, purpose, and status, with copy buttons. The records depend on where your DNS lives. WP Waterfall tells you which case you are in, with one sentence on why.

**My DNS is on WP Waterfall DNS.** You are done. WP Waterfall writes the validation records and the routing CNAME into your zone, the certificate issues, and the domain goes live. It keeps the records right by itself. To move DNS to WP Waterfall DNS, see [Cloudflare DNS](https://docs.wpwaterfall.com/dns).

**My DNS is on my own Cloudflare account.** Add a CNAME for the domain that points to `sites.wpwaterfall.dev`, and set it to **DNS only** (the grey cloud). Cloudflare flattens a CNAME at the root of a domain, so it works for `example.com` as well as `www.example.com`. Add the ownership TXT and the `_acme-challenge` CNAME from the table below as well, and set them to DNS only too.

**My DNS is somewhere else.** The tab lists these records. For `example.com`:

| Type | Name | Value | Purpose |
| --- | --- | --- | --- |
| TXT | `_wpwaterfall-challenge.example.com` | `wpwaterfall-domain-verify=` and a code | Proves you own the domain. Add it first. |
| CNAME | `example.com` | `sites.wpwaterfall.dev` | Points the domain at your site. |
| CNAME | `_acme-challenge.example.com` | `<your site id>.acme.sites.wpwaterfall.dev` | Lets the server get its own certificate. Keep it, because renewals use it. |
| TXT | `_cf-custom-hostname.example.com` | the value on the tab | Optional. Lets Cloudflare confirm the domain before the first CNAME moves. |

DNS allows no TXT record at the same name as the `_acme-challenge` CNAME, so remove any other record at that name first. The www name gets the same records at its own names. Copy the exact values from the tab. For what the `_acme-challenge` record does, see [SSL certificates](https://docs.wpwaterfall.com/ssl-certificates).

1. Add the records at your DNS provider.
2. WP Waterfall checks them every minute and marks each one found. To check now, open the domain's menu and choose **Verify**, or choose **View DNS records**, then **Check again**.
3. If a record is wrong, the check names it. Fix it and check again.

When the records resolve, the domain shows **Securing your site** for a minute or two, then **Active**. A wildcard such as `*.shop.example` covers one label and uses TXT validation records. With DNS elsewhere you cannot add both `*.shop.example` and `shop.example`, because both need a record at `_acme-challenge.shop.example`. Move the DNS to Cloudflare DNS to use both.

### Does an A record work?

Not today. Connect a domain with the CNAME. Cloudflare accepts an A record only at addresses tied to WP Waterfall's account, and those fixed addresses do not exist yet. An A record at an address you find by looking up `sites.wpwaterfall.dev` leaves the domain pending. Once WP Waterfall has fixed addresses, a name at a DNS host other than Cloudflare connects with one A record for each IPv4 address on the tab and one AAAA record for each IPv6 address, if the tab lists any. A CNAME you set before keeps working then, and the tab says so. Without AAAA records, visitors on IPv6 still reach your site over IPv4.

The fixed addresses will belong to WP Waterfall's account at Cloudflare, and they rarely change. If they do, WP Waterfall tells you, the old addresses keep working while you update your records, and the Domains tab and **Info** show the new ones. A CNAME never needs updating, and WP Waterfall DNS follows any change by itself.

### What if my DNS host cannot point the bare domain?

DNS allows a CNAME at the root of a domain, such as `example.com`, only at a host that flattens it. Some hosts call this ALIAS, ANAME, or CNAME flattening. Cloudflare does it. Many registrars do not, and a bare domain cannot connect at those hosts. `www.example.com` connects at any DNS host. If yours cannot, you have two ways forward:

- Connect `www.example.com`, and forward `example.com` to it at your DNS host if it offers that.
- Move the domain's DNS to WP Waterfall DNS for free. WP Waterfall then writes every record, and the bare domain works. See [Cloudflare DNS](https://docs.wpwaterfall.com/dns).

### What if the domain already has a CNAME?

A CNAME to `sites.wpwaterfall.dev` is the right record, and nothing turns red. A CNAME you set before to a site's temporary address keeps working too. If WP Waterfall hosts your DNS, it replaces that CNAME with one to `sites.wpwaterfall.dev` for you. If your DNS is elsewhere, change the CNAME to `sites.wpwaterfall.dev`. A site rename removes the temporary domain an older CNAME points at, so change the CNAME before you rename. Choosing **Rename** warns you when a domain still needs it. See [Your site's temporary domain](https://docs.wpwaterfall.com/temporary-domain).

## What if Cloudflare reports an error?

Once your records are in place, the domain's records show **Cloudflare says**, followed by Cloudflare's own words. Our team hears about it at the same time. A CAA record that does not allow the certificate authority is a common cause, and the message names the record it could not read. Fix it at your DNS host, and WP Waterfall keeps checking. The API returns the same words in `cloudflare_errors` from `GET /v1/domains/{id}/verification-records`.

Cloudflare says "custom hostname does not CNAME to this zone" from the moment a domain is added. WP Waterfall shows it only if it is still true 30 minutes after your record is in place, because until then it only means Cloudflare has not looked again yet.

If Cloudflare has blocked a name, the domain fails at once and says so. Message Nami from the chat button.

If WP Waterfall says custom domains do not reach this site's server, the server runs older WP Waterfall software and WP Waterfall refuses the domain instead of leaving visitors with an error page. Message Nami from the chat button and ask for an update or a move of the site. The temporary domain keeps working meanwhile.

## What if another account already uses the domain?

Two accounts cannot both hold one domain. Adding a domain someone else is about to use is allowed, because an unproven claim holds nothing. The claim that is proven first holds the name.

If you prove a domain that another account already holds, WP Waterfall tells you it is connected to another WP Waterfall account and does not say which one. Ask that account to remove it, or message Nami from the chat button. If the other account's ownership record has been missing for 3 days, and you can prove control now, WP Waterfall releases the domain to you.

## What if the ownership record goes missing?

When WP Waterfall's daily check no longer finds the record, the domain keeps working and shows **Ownership record missing** with the date it was last seen. Add the record again and the warning clears. After 3 days without it, another account that proves control of the domain can take it.

## How do I move a site that is live elsewhere?

Use Avoid downtime. Add the `_acme-challenge` CNAME and the ownership TXT while the site still runs at the old host. The domain then shows **Ready to move**. When you are ready, add the routing record and remove the old host's records at that name. That is the cutover. HTTPS can be unavailable for a few minutes while Cloudflare issues its certificate, so pick a quiet time. For a whole migration, see [Migrate a site](https://docs.wpwaterfall.com/migrate-a-site).

If the domain already uses WP Waterfall DNS, there is nothing to move by hand. WP Waterfall waits until the certificate is ready, then points the domain at your site and replaces the old host's A, AAAA, or CNAME records at that name. Mail and text records stay. The zone is saved first, so you can restore it from its snapshots.

## How do I use a domain for one site of a network?

On a [WordPress Multisite](https://docs.wpwaterfall.com/wordpress-multisite) network, **Add domain** asks what the domain is for. Leave **The whole network**, or pick one site. A domain for one site is a single plain name, with no www pair, wildcard, or primary switch. If you remove it, the site moves back under the network address. Send `subsite_id` with the blog id in `POST /v1/environments/{id}/domains`.

## How do I make a domain primary?

Choose **Make primary** in the domain's menu. Only active domains on live can be primary. WP Waterfall rewrites the WordPress home and site URLs, adds a 301 redirect from the old primary, and purges the edge and server caches. On a network, the whole network moves to the domain, and sites with their own domain stay put.

## How do I refresh SSL?

Choose **Refresh SSL** in a row's menu, the temporary domain included. Use it when a certificate looks stuck, a record was deleted, or a browser shows a certificate warning. WP Waterfall also does this by itself: see [SSL certificates](https://docs.wpwaterfall.com/ssl-certificates).

- For a custom domain, WP Waterfall rereads the certificate state from Cloudflare, writes validation records missing from a Cloudflare DNS zone, and orders the server certificate again if it is missing or near its end. The domain must be active.
- For the temporary domain, WP Waterfall installs its certificate on the server again.

It runs as a job, and a second click while it runs starts nothing.

## What does Force HTTPS do?

Open **Tools** and find the **Force HTTPS** card. **All domains** sends HTTP to HTTPS on every hostname. **Primary domain only** does that and also sends every hostname to the primary domain. **Disabled** turns it off.

Cloudflare sends HTTP to HTTPS in rules that every site shares. If those rules have no room for your site, your site's web server sends the redirect instead, and the job says so. Visitors get the same redirect either way. WP Waterfall checks every hour and moves the redirect back to Cloudflare by itself once there is room.

## How do I remove a domain?

Open the domain's menu and choose **Remove domain**, or tick several rows and choose **Manage N domains**. The temporary and primary domains cannot be removed: make another primary first. WP Waterfall reverses every attach step, deletes the certificate, and runs one job per domain. Then delete the domain's A, AAAA, and CNAME records at your DNS host yourself. Records that still point at WP Waterfall do nothing for anyone else, because a new account has to prove ownership first and only you control your DNS.

Remove the last custom domain of a live site and the site leaves Patchstack until you connect another. Make another domain primary and the protection moves to it.

Both API calls need `confirm: true`. Deleting a site or an environment removes its domains the same way, and the names are free at once. A check every 10 minutes releases any domain left on a site that no longer exists. Adding the domain again asks for a new ownership record, unless an active DNS zone or a proven parent domain on your account covers it.

## Quick answers

**Check again says a record is wrong, but I set it.**
DNS changes take time to spread. Compare the value the check names with your provider, then check again. If it still fails, see [Domain is not resolving](https://docs.wpwaterfall.com/troubleshooting-domain-not-resolving).

**My DNS provider refuses the `_acme-challenge` record.**
Remove any other record at that name first, such as an old TXT record. A CNAME cannot share its name.

## API

- `GET`, `POST`, and `DELETE /v1/environments/{id}/domains`. `GET` shows `ownership_proof` for each domain: the method, the state (`pending`, `expired`, `verified`, or `lapsed`), and the record to add.
- `GET`, `PATCH`, and `DELETE /v1/domains/{id}`
- `GET /v1/domains/{id}/verification-records`: the records with the last check, `dns_addresses` (empty until WP Waterfall has fixed addresses), where the DNS lives (`dns_provider`: `wpwaterfall`, `cloudflare`, or `other`), the record form (`routing_mode`: `cname` or `a_records`), how the name routes (`routing`), and plain `notes`. `cname_target` is always null: the CNAME is a row of `records`.
- `POST /v1/domains/{id}/verify` and `POST /v1/domains/{id}/primary`
- `POST /v1/environments/{id}/ssl/refresh` with `domain_id`, or `null` for the temporary domain. In MCP, use `refresh_ssl`.

`POST /v1/environments/{id}/domains` takes `include_www`. Left out, it is on for a bare name such as `example.com` and for `www.example.com` on live, and off for other subdomains, wildcards, and staging. Send `false` to add one name only. Refusals use these codes: `hostname_in_use`, `hostname_taken`, `live_not_launched`, `live_domain_required`, `not_under_live_domain`, and `domain_not_proven`. In MCP, `add_domain`, `get_domain_status`, and `verify_domain` follow the same rules.

## Related

- [SSL certificates](https://docs.wpwaterfall.com/ssl-certificates)
- [Cloudflare DNS](https://docs.wpwaterfall.com/dns)
- [Domain is not resolving](https://docs.wpwaterfall.com/troubleshooting-domain-not-resolving)
- [Redirects](https://docs.wpwaterfall.com/redirects)
- [Edge cache and CDN](https://docs.wpwaterfall.com/edge-cache)
