Domains
Add a domain to a site, set and check its DNS records, move a site that is live elsewhere, make it primary, and turn on Force HTTPS.
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 domain visitors use, its status, its SSL certificate, and the Change primary button. Until you make one of your own domains primary, the temporary domain is the primary.
- Domains list below it: 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.
Add a domain
Custom domains attach to live. A new site runs on staging only, so choose Launch live first; staging and multidevs keep their temporary domains. Adding a domain to staging answers "Launch live first" (code live_not_launched), or "Custom domains attach to live" (code live_required) once the site has launched.
- Open your site, then Domains.
- Choose Add domain.
- Step 1: type the domain. Leave Also add www ticked to add the apex and the www name in one step.
- Choose Add domain.
- Step 2: the dialog shows the exact DNS records to set, each with a copy button. Avaloi checks them every few seconds and marks each one found. Choose Done when you are finished. Avaloi keeps checking after you close it.
More options in step 1 holds a wildcard, Prepare first, and making the domain primary once it is active. A wildcard covers one label, such as *.shop.example.
The first row of the table is not a domain you added. It is the temporary domain Avaloi assigned to the environment, marked Temporary. You cannot remove it or make it primary, but you can rename it from its menu. See Your site's temporary domain.
Avaloi creates the domain and starts the attach job. The Domains tab shows its progress. What happens next depends on where the domain's DNS is hosted.
When the DNS is on Cloudflare DNS
If the domain's DNS is a Cloudflare DNS zone, you are done. The job writes the validation records and the CNAMEs into your zone, the certificate issues, and the domain goes live. There is nothing to type.
See Cloudflare DNS to move a domain's DNS to Cloudflare DNS.
When the DNS is elsewhere
If the DNS is at another provider, the Domains tab shows a table of records for each domain, with the type, name, value, purpose, and status of each one, and a copy button for the name and the value. For example.com they are:
| Type | Name | Value | Purpose |
|---|---|---|---|
| CNAME | example.com |
sites.avaloi.com |
Points the domain at Avaloi |
| CNAME | _acme-challenge.example.com |
<your site id>.acme.sites.avaloi.com |
Server certificate |
| TXT | _cf-custom-hostname.example.com |
the value on the tab | Ownership (optional) |
The www name gets the same three records at its own names. Copy the exact values from the tab.
- The first CNAME sends visitors to Avaloi. Once it points here, Cloudflare checks the domain and issues the HTTPS certificate on its own. You add nothing for that certificate.
- The
_acme-challengeCNAME lets the Avaloi server get its own certificate for your domain. Keep it in place: renewals use it. Do not add a TXT record at that name as well; DNS allows only one record next to a CNAME. - The ownership TXT is optional. It lets Cloudflare confirm the domain before the first CNAME moves.
At the root of the domain (example.com rather than www.example.com) most DNS providers do not allow a plain CNAME. Use the record your provider offers for this, often called CNAME flattening, ALIAS, or ANAME, with the same value. If your provider has none, move the domain's DNS to Cloudflare DNS, or use only the www name.
- Add the records at your DNS provider.
- Avaloi checks them every minute and marks each one found. To check at once, open the domain's menu and choose Verify, or choose View DNS records, then Check DNS.
- If a record is wrong, the check names the exact record. Fix it and check again.
Once the records resolve and Cloudflare has issued the HTTPS certificate, the domain shows Securing your site while Avaloi installs the server certificate. That takes a minute or two. Then it shows Active. The check changes nothing. Avaloi waits up to 72 hours for the records, and the tab shows when it last checked.
A wildcard, such as *.shop.example, uses TXT records from Cloudflare instead. If your DNS is elsewhere, you cannot add both *.shop.example and shop.example, because both would need a record at _acme-challenge.shop.example. Move the DNS to Cloudflare DNS to use both.
Move a site that is live elsewhere
Prepare first splits the setup in two. First add the _acme-challenge CNAME and the ownership TXT while the site still runs at the old host. The server certificate issues and the domain shows Ready to move. When you are ready, move the first CNAME to sites.avaloi.com. That is the cutover. Cloudflare issues the HTTPS certificate within a few minutes of the move, so HTTPS can be unavailable for those minutes. Plan the move for a quiet time.
You can change the setup mode of a domain after you add it.
Make a domain primary
Choose Change primary in the Primary domain block, or open the domain's menu and choose Make primary. Only active domains can be primary. Avaloi:
- Rewrites the WordPress home and site URLs.
- Adds a 301 redirect from the old primary to the new one.
- Purges both caches, edge and server.
Force HTTPS
Force HTTPS has two settings. One sends HTTP to HTTPS on every hostname. The other also sends every hostname to the primary domain. Change it on the Domains tab.
Remove a domain
Open the domain's menu and remove it. Avaloi reverses every attach step and deletes the certificate. You can also select several domains and remove them together: Avaloi runs one removal job per domain in one group. Both API calls need confirm: true.
Limits
- Avaloi waits up to 72 hours for the DNS records after you add a domain.
- A wildcard covers one label.
Quick answers
Check DNS says a record is wrong, but I set it. DNS changes take time to spread. Compare the value the check names with what your provider shows, then check again.
Can I move my site to Avaloi without downtime? Almost. Use Prepare first, wait until the domain shows Ready to move, then move the CNAME. The site keeps working; HTTPS can take a few minutes after the move while Cloudflare issues the certificate.
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 with another record.
My DNS provider will not let me add a CNAME at the root of the domain. Use its CNAME flattening, ALIAS, or ANAME record with the same value. If it has none, move the DNS to Cloudflare DNS.
Does making a domain primary change my content? It rewrites the home and site URLs and adds a redirect from the old primary. Posts and uploads stay as they are.
Do I need to add records by hand if my DNS is on Cloudflare DNS? No. The attach job writes every record for you.
API
GET /v1/environments/{id}/domainsPOST /v1/environments/{id}/domainsPUT /v1/environments/{id}/temp-hostnameDELETE /v1/environments/{id}/domainsGET /v1/domains/{id}PATCH /v1/domains/{id}DELETE /v1/domains/{id}GET /v1/domains/{id}/verification-recordsPOST /v1/domains/{id}/verifyPOST /v1/domains/{id}/primary
Related
- Cloudflare DNS
- Redirects
- Edge cache and CDN
- Domain registration (planned)
- Domain transfers (planned)
Still stuck?
Email [email protected] with your site name and what you tried, or send us a message.