Domain Verification
Domain verification in RelayPost proves to receiving mail servers that you authorized RelayPost to send email for your domain. RelayPost generates DKIM keys and a DMARC record you add to DNS, then verifies them automatically. Verified domains achieve significantly better inbox placement.
How it works
Section titled “How it works”When you add a domain, RelayPost generates:
- A DKIM key pair — used to cryptographically sign your emails
- A DMARC record — that tells receiving servers how to handle authentication failures
- DNS records — that you add to your domain’s DNS settings
Once the records are in place, RelayPost verifies them and marks your domain as verified.
Note: SPF is handled automatically by RelayPost’s sending infrastructure (via the MAIL FROM domain). You do not need to add an SPF record for RelayPost.
Add and verify a domain
Section titled “Add and verify a domain”-
Add the domain
POST
/api/v1/domainsTerminal window curl -X POST https://api.relaypost.dev/v1/domains \-H "Content-Type: application/json" \-H "Authorization: Bearer YOUR_API_KEY" \-d '{ "domain": "yourapp.com" }'Response:
{"data": {"id": "dom_abc123","domain": "yourapp.com","is_verified": false,"dkim_verified": false,"dkim_selector": "relaypost","dkim_public_key": "MIGfMA0GCSqGSIb3DQEBAQUAA4...","dns_records": [{"type": "TXT","name": "relaypost._domainkey.yourapp.com","value": "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4..."},{"type": "TXT","name": "_dmarc.yourapp.com","value": "v=DMARC1; p=quarantine"}],"created_at": "2025-01-15T10:30:00.000Z"}}The response includes the
dkim_selectoranddkim_public_keyyou’ll need for DNS. SPF is handled automatically by RelayPost’s sending infrastructure. -
Add DNS records
Add these records at your DNS provider (Cloudflare, Route 53, Namecheap, etc.):
DKIM record (TXT)
Field Value Type TXTName {dkimSelector}._domainkey.yourapp.comValue v=DKIM1; k=rsa; p={dkimPublicKey}DMARC record (TXT)
Field Value Type TXTName _dmarc.yourapp.comValue v=DMARC1; p=quarantine -
Trigger verification
DNS propagation can take up to 48 hours, but usually completes within minutes. Once propagated:
GET
/api/v1/domains/:id/verifyTerminal window curl "https://api.relaypost.dev/v1/domains/dom_abc123/verify" \-H "Authorization: Bearer YOUR_API_KEY"Response:
{"data": {"id": "dom_abc123","domain": "yourapp.com","is_verified": true,"dkim_verified": true,"dkim_selector": "relaypost","dkim_public_key": "MIGfMA0GCSqGSIb3DQEBAQUAA4...","verified_at": "2025-01-15T11:00:00.000Z","created_at": "2025-01-15T10:30:00.000Z"}}The response shows which checks passed.
dkim_verifiedmust betruefor full verification.
Check domain status
Section titled “Check domain status”GET /api/v1/domains
curl "https://api.relaypost.dev/v1/domains" \ -H "Authorization: Bearer YOUR_API_KEY"Response:
{ "data": [ { "id": "dom_abc123", "domain": "yourapp.com", "is_verified": true, "dkim_verified": true, "dkim_selector": "relaypost", "dkim_public_key": "MIGfMA0GCSqGSIb3DQEBAQUAA4...", "verified_at": "2025-01-15T11:00:00.000Z", "created_at": "2025-01-15T10:30:00.000Z" } ]}Troubleshooting
Section titled “Troubleshooting”| Issue | Solution |
|---|---|
| DKIM fails | Check the selector name matches exactly: {selector}._domainkey.yourapp.com |
| DMARC fails | Ensure the TXT record is at _dmarc.yourapp.com with value starting with v=DMARC1 |
| Both fail | DNS may not have propagated yet — wait 15-30 minutes and try again |
| Still failing | Some DNS providers add quotes around TXT values automatically — make sure there aren’t double quotes |
Frequently Asked Questions
Section titled “Frequently Asked Questions”How long does domain verification take?
Section titled “How long does domain verification take?”DNS propagation typically completes within 5–30 minutes, though it can take up to 48 hours in rare cases. Once DNS records are in place, trigger a verification check from the API or dashboard.
What DNS records do I need to add?
Section titled “What DNS records do I need to add?”You need two TXT records: a DKIM record at selector._domainkey.yourdomain.com with your public key, and a DMARC record at _dmarc.yourdomain.com with your DMARC policy. SPF is handled automatically by RelayPost’s sending infrastructure.
Why is my domain verification failing?
Section titled “Why is my domain verification failing?”Common causes: DNS records haven’t propagated yet (wait 15–30 minutes), the DKIM selector name doesn’t match exactly, your DNS provider added extra quotes around the TXT value, or you have multiple SPF records on the same domain (merge them into one).