Verify your domain for production email delivery
Configure DNS records for SPF, DKIM, and DMARC with step-by-step guidance.
Overview
Verify your sending domain to improve deliverability and prove to mailbox providers that you own the domain. Bavimail requires SPF, DKIM, DMARC, and Return-Path DNS records.
Verification Steps
Add Your Domain
Register your sending domain via the SDK.
import { Bavimail } from 'bavimail'
const client = new Bavimail()
const domain = await client.domains.create({
domain: 'mail.yourcompany.com',
inboundEnabled: false,
})
console.log('Domain ID:', domain.id)
console.log('DNS records to add:', domain.dnsRecords)Add DNS Records
Add the records returned by the API to your DNS provider. You will receive records for:
| Record | Type | Purpose |
|---|---|---|
| SPF | TXT | Authorizes Bavimail's IP addresses to send email on behalf of your domain. |
| DKIM | CNAME | Cryptographic signature that proves the email was sent by an authorized server and was not altered in transit. |
| DMARC | TXT | Tells receiving servers how to handle email that fails SPF or DKIM checks. |
| Return-Path | CNAME | Routes bounce notifications back to Bavimail so you get delivery feedback. |
Wait for Verification
Once you have added the DNS records, Bavimail verifies the domain automatically — there is nothing to trigger. Poll the domain to watch its status change to verified:
const domain = await client.domains.get(domainId)
console.log('Status:', domain.status) // 'pending' | 'verified' | 'failed'Bavimail re-checks your DNS records every few minutes until they resolve, then marks the domain verified.
Start Sending
Once status is verified, you can create aliases on the domain and send email.
Common Issues
- DNS propagation takes time. Most providers propagate within minutes, but some take up to 48 hours. If verification fails, wait and retry.
- CNAME conflicts. Some DNS providers don't allow a CNAME at the zone apex. Use a subdomain (e.g.,
mail.yourcompany.com) instead. - Existing SPF records. If you already have an SPF record, merge it with the Bavimail include rather than creating a second TXT record. Multiple SPF records cause failures.
- DMARC policy too strict. Start with
p=nonewhile testing, then move top=quarantineorp=rejectonce you confirm delivery is working.
Multiple SPF TXT records on the same domain will cause verification failures. Merge them into a single record.