# DNS validation

> What Onetime Secret checks before it serves your custom domain, what each domain status means, and how to fix a failed check.

After you add a custom domain and create its DNS records, Onetime Secret checks the records before it serves the domain. For creating the records, see [Setting up a custom domain](/en/custom-domains/setup-guide).

## What is checked

Four things have to be in place before your domain works. They are checked separately:

| Stage           | What decides it                                                                                                                                                                                     | What you see until it is done                                                                                                                                                                    |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Ownership**   | The TXT ownership record is found with the right value                                                                                                                                      | The status shows **Pending Verification** or **Inactive**, and secrets cannot be created on the domain |
| **Routing** | Your CNAME or A record points at the target shown on the domain’s verification page | Visitors do not reach Onetime Secret; the status shows **DNS Incorrect** or **Inactive**                                                           |
| **Certificate**       | The service obtains a TLS certificate for the domain                                                                                                                                          | The status can show **Certificate pending**                                                                                                                                                    |
| **Serving**       | Ownership is verified                                                                                                                                                                                                   | Visitors who do reach the service get “This domain is not configured”                                                                                                                      |

Only the TXT record decides verification. A correct CNAME or A record without the TXT record never verifies. A certificate is not proof of ownership either: depending on how the service is set up, a certificate can be requested as soon as you add the domain, but the domain is still not served until the TXT record is verified.

## When checks run

* **Verify Domain** on the domain’s verification page checks it immediately. There is a short pause before you can use the button again.
* The service also re-checks domains in the background on a schedule. A check can finish without you doing anything.

DNS changes often take effect within minutes, but can take a day or longer, depending on your DNS provider and the records’ time to live (TTL).

## Domain statuses

The domain’s page shows one of these statuses. On the Domains tab, a domain that needs attention shows its status as text; a domain that is ready shows a check mark.

| Status                                            | Meaning                                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Active**                                                  | Ownership is verified, the domain resolves to the service, and it is ready to use.                                                                                                                                                                                               |
| **Pending Verification**                      | The domain resolves to the service, but the TXT ownership record has not been verified, or it was verified and has since gone. Create or restore the TXT record. |
| **Certificate pending** | Ownership is verified and the domain resolves, but no valid certificate has been seen yet. The service obtains one; nothing to do.                                                                                                     |
| **DNS Incorrect**                   | The routing record does not point at the expected target.                                                                                                                                                                                                                                                                              |
| **Unverified**                          | The last status check failed, so the current state is unknown. Choose **Verify Domain** to try again.                                                                                                                                                                    |
| **Inactive**                                | No status has been recorded yet, or the last check reported a state other than those above. Check the routing record.                                                                                            |

## If the TXT record is removed later

Verification is repeated after the domain is active.

* When a check gets a clear answer that the TXT record is missing or wrong, the domain is no longer verified and stops being served at once. It is served again after a check finds the record.
* When checks get no clear answer, for example because a DNS server did not respond, a verified domain stays verified. If checks are still inconclusive more than 7 days after the first one, the domain loses verification.

## Troubleshooting

* **Wrong or missing record:** compare the record type, host and value with the ones on the domain’s verification page.
* **Missing TXT record:** a correct CNAME or A record alone never verifies. Copy the TXT record’s host and value from the verification page.
* **More than one TXT value:** the ownership record must be the only TXT record at its name. Remove values left from an earlier attempt.
* **Host entered twice:** some DNS providers add the zone to the host you enter. If the record resolves at a name such as `_onetime-challenge-abc1234.example.com.example.com`, enter only the label.
* **Conflicting records:** remove other A, AAAA or CNAME records for the same host. Never remove the TXT ownership record.
* **Apex domain:** an apex domain cannot use a CNAME record. Use an A record.
* **Propagation delay:** wait and choose **Verify Domain** again.

If the problem persists, including any certificate error, contact support.

> **Note**
>
> **Self-hosting this yourself?** Each installation uses one validation strategy, set with `DOMAINS_VALIDATION_STRATEGY`. With `approximated` or `caddy_on_demand`, a domain is served only after its TXT record is verified, unless `DOMAINS_SERVE_UNVERIFIED=true` or an operator has overridden its verification; with `caddy_on_demand`, the certificate is also issued only after verification. With `passthrough`, the default, there is no DNS check: a domain is served once it is added, and certificates are handled outside the application. See [Environment variables](/en/reference/environment-variables).

## Related

* [Setting up a custom domain](/en/custom-domains/setup-guide) — add the domain and create its DNS records.
* [Custom domains](/en/custom-domains) — plans, roles, and where the domain is served.
* [Where your data lives](/en/security/where-your-data-lives) — the regional sites and their targets.

## Questions or need support?

Email [support@onetimesecret.com](mailto:support@onetimesecret.com) or use the [feedback form](https://onetimesecret.com/feedback).