DNS Handling proves that the caller controls a domain by requiring them to publish a specific token as a DNS TXT record. This approach — placing a secret value in DNS — is a widely-used ownership-proof mechanism because only someone with DNS write access to the zone can create or modify records. The service generates a unique, cryptographically unpredictable token at registration time and then, on demand, queries DNS to confirm the record is present before advancing the domain toDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/plutoploy/dns-handling/llms.txt
Use this file to discover all available pages before exploring further.
verified.
How the verification token is generated
Every domain registration generates a fresh token usingGenerateToken() in internal/domain/domain.go:
crypto/rand (the operating-system CSPRNG), computes a SHA-256 digest of those bytes, and returns the result as a lowercase hexadecimal string. Because SHA-256 always produces a 32-byte digest, the token is always 64 hex characters long. Every call to GenerateToken() produces a statistically unique value.
The challenge domain format
The TXT record must be published at a specific subdomain derived from the registered domain name. The format is computed byChallengeDomain():
example.com, the challenge domain is:
Setting up the DNS record
After callingPOST /domains, the response includes both the verification_token and an instructions string showing exactly what to publish:
300 seconds in the example above) is at your discretion; a low TTL makes propagation faster.
What happens during POST /domains//verify
CallingPOST /domains/{id}/verify triggers the VerifyDomain handler, which performs the following steps in order:
Resolve the challenge domain
The handler calls
dns.LookupTXT() on _acme-challenge.<domain>. using Go’s net.DefaultResolver. The DNS resolver is configured with a 10-second timeout (set in config.DNSTimeout). If the lookup fails — for example because the record has not propagated yet — the handler returns HTTP 424 Failed Dependency.Strip surrounding quotes
DNS TXT records are sometimes returned with surrounding double-quote characters depending on the resolver implementation. The
NetResolver strips them before returning the slice:Match against the stored token
domainSvc.VerifyTXT() iterates over the returned records and performs an exact string comparison against the domain’s verification_token. The first match is sufficient; additional TXT records at the same name are ignored.Example: complete verification flow
The domain must be in
pending status when POST /domains/{id}/verify is called. If the domain has already been verified, or is in any other status, VerifyTXT() returns an error and the handler responds with HTTP 400.