This guide covers DNS configuration for each domain added to GoMail.
When you add a domain to GoMail via the admin panel, the server displays:
- DKIM public key (for signing outbound emails)
- DNS records required for authentication and delivery
These must be configured in your domain's DNS provider.
For each domain, configure 3 essential records:
| Record | Example | Purpose |
|---|---|---|
| MX | example.com MX 10 mail.example.com. |
Route mail to your server |
| SPF | example.com TXT "v=spf1 mx ~all" |
Sender authentication |
| DKIM | mail._domainkey.example.com TXT "v=DKIM1; k=ed25519; p=..." |
Email signing |
Optional but recommended:
- DMARC — Policy for failed auth checks
- CAA — Certificate authority authorization
- Reverse DNS (PTR) — Critical for deliverability
Maps mail server hostname to IP address.
mail.example.com A 203.0.113.1
| Field | Value |
|---|---|
| Type | A |
| Name | mail.example.com |
| Value | Your server IP (e.g., 203.0.113.1) |
| TTL | 3600 |
For IPv6:
mail.example.com AAAA 2001:db8::1
Tells other servers where to send emails for your domain.
example.com MX 10 mail.example.com.
| Field | Value |
|---|---|
| Type | MX |
| Name | @ (root domain, or leave blank) |
| Mail Server | mail.example.com. (with trailing dot) |
| Priority | 10 (lower = higher priority) |
| TTL | 3600 |
For multiple mail servers:
example.com MX 10 mail1.example.com.
example.com MX 20 mail2.example.com.
Specifies which servers can send email for your domain.
example.com TXT "v=spf1 mx ~all"
| Field | Value |
|---|---|
| Type | TXT |
| Name | @ (root domain) |
| Value | v=spf1 mx ~all |
| TTL | 3600 |
Explanation:
v=spf1— SPF versionmx— Allow MX serversa— Allow A record~all— Soft fail (treat others as suspicious)-all— Hard fail (reject others) - use after testing
Multi-provider example:
v=spf1 mx include:sendgrid.net include:mailgun.org ~all
Proves emails from your domain are genuine. GoMail generates unique keys per domain.
mail._domainkey.example.com TXT "v=DKIM1; k=ed25519; p=fD0qv..."
| Field | Value |
|---|---|
| Type | TXT |
| Name | mail._domainkey.example.com (selector=mail) |
| Value | Full key from admin panel |
| TTL | 3600 |
How to get your key:
- Go to GoMail Admin → Domains
- Click your domain
- Scroll to "DNS Records"
- Find DKIM TXT record
- Copy entire
v=DKIM1...string - Paste into DNS provider
Different algorithms:
ED25519 (smaller, faster):
v=DKIM1; k=ed25519; p=fD0qv7dVKOLqgK1X...
RSA (wider compatibility):
v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4...
Specifies how receivers handle emails failing DKIM/SPF.
_dmarc.example.com TXT "v=DMARC1; p=quarantine; rua=mailto:admin@example.com"
| Field | Value |
|---|---|
| Type | TXT |
| Name | _dmarc.example.com (exact) |
| Value | See below |
| TTL | 3600 |
Policies (choose one):
# Monitor only (recommended start)
v=DMARC1; p=none; rua=mailto:admin@example.com; fo=1
# Quarantine (spam folder)
v=DMARC1; p=quarantine; rua=mailto:admin@example.com
# Reject (strict, use after testing)
v=DMARC1; p=reject; rua=mailto:admin@example.com
Parameters:
p=none|quarantine|reject— Action policyrua=mailto:email— Aggregate report recipientruf=mailto:email— Forensic report recipientadkim=r|s— Relaxed (r) or strict (s) DKIM alignmentaspf=r|s— Relaxed (r) or strict (s) SPF alignmentfo=0|1— Report all failures (1) or only policy fails (0)
Restricts which CAs can issue certificates for your domain.
example.com CAA 0 issue "letsencrypt.org"
| Field | Value |
|---|---|
| Type | CAA |
| Name | @ (root domain) |
| Flags | 0 |
| Tag | issue |
| Value | letsencrypt.org |
| TTL | 3600 |
For multiple CAs:
example.com CAA 0 issue "letsencrypt.org"
example.com CAA 0 issue "digicert.com"
Critical for email deliverability. Configure with your hosting provider.
| Field | Value |
|---|---|
| Type | PTR |
| IP | 203.0.113.1 (your server) |
| Hostname | mail.example.com. |
Verify:
dig -x 203.0.113.1
# Should return: mail.example.comForces TLS connections and prevents downgrade attacks.
_mta-sts.example.com TXT "v=STSv1; id=20250101"
| Field | Value |
|---|---|
| Type | TXT |
| Name | _mta-sts.example.com (exact) |
| Value | v=STSv1; id=<date> |
| TTL | 3600 |
Plus HTTP-served policy file at https://mta-sts.example.com/.well-known/mta-sts.txt:
version: STSv1
mode: enforce
max_age: 604800
mx: mail.example.com
Receive reports about TLS connection failures.
_smtp._tls.example.com TXT "v=TLSRPTv1; rua=mailto:admin@example.com"
| Field | Value |
|---|---|
| Type | TXT |
| Name | _smtp._tls.example.com (exact) |
| Value | v=TLSRPTv1; rua=mailto:admin@example.com |
| TTL | 3600 |
For example.com on server mail.example.com (IP: 203.0.113.1):
# Infrastructure
example.com A 203.0.113.1
mail.example.com A 203.0.113.1
# Mail routing
example.com MX 10 mail.example.com.
# Authentication
example.com TXT "v=spf1 mx ~all"
mail._domainkey.example.com TXT "v=DKIM1; k=ed25519; p=fD0qv..."
_dmarc.example.com TXT "v=DMARC1; p=quarantine; rua=mailto:admin@example.com"
# Security (optional)
example.com CAA 0 issue "letsencrypt.org"
_mta-sts.example.com TXT "v=STSv1; id=20250101"
_smtp._tls.example.com TXT "v=TLSRPTv1; rua=mailto:admin@example.com"
With PTR record (configured at hosting provider):
- 203.0.113.1 PTR mail.example.com.
For domains example.com, example.org, example.net all pointing to same server:
# example.com
example.com MX 10 mail.example.com.
example.com TXT "v=spf1 mx ~all"
mail._domainkey.example.com TXT "v=DKIM1; k=ed25519; p=<unique-key-1>"
# example.org
example.org MX 10 mail.example.com.
example.org TXT "v=spf1 mx ~all"
mail._domainkey.example.org TXT "v=DKIM1; k=ed25519; p=<unique-key-2>"
# example.net
example.net MX 10 mail.example.com.
example.net TXT "v=spf1 mx ~all"
mail._domainkey.example.net TXT "v=DKIM1; k=ed25519; p=<unique-key-3>"
# Shared server records (one A record for all domains)
mail.example.com A 203.0.113.1
Key points:
- All domains have different DKIM keys (generated per domain in admin panel)
- All domains point MX to same mail server (mail.example.com)
- Single A record for mail server IP
- Different DKIM name per domain:
mail._domainkey.example.comfor example.commail._domainkey.example.orgfor example.org- etc.
After adding records, verify propagation:
# Check MX
dig example.com MX
# Check SPF
dig example.com TXT | grep spf
# Check DKIM
dig mail._domainkey.example.com TXT
# Check DMARC
dig _dmarc.example.com TXT
# Check CAA
dig example.com CAAOnline tools:
- MXToolbox — MX, SPF, DKIM, DMARC
- mail-tester — Complete email auth test
- DMARC Analyzer — DMARC validation
- What is my PTR — Reverse DNS check
All required records displayed in Admin → Domains → [Domain Name]:
- DKIM Public Key — Full TXT record value (copy directly)
- Selector — Usually "mail" (matches _domainkey name)
- Algorithm — ED25519 or RSA
- Key generation date — When DKIM key was created
- DNS Records section — All recommended records with exact names/values
- Immediate: A/MX records cached locally
- 5-15 minutes: Usually global propagation
- 24 hours: Guarantee all nameservers updated (TTL)
- Recommendation: Add SPF/DKIM/DMARC and wait 1 hour before testing
- Verify MX record:
dig example.com MX→ should show mail.example.com - Verify A record:
dig mail.example.com A→ should show your IP - Check MX priority (lower = preferred)
- Verify server is listening on port 25
- Check TXT record name: exactly
mail._domainkey.example.com - Verify full key copied (no truncation in TLS limit)
- Check selector matches config (
dkim.default_selector) - Wait for TTL if recently added
- Verify DKIM key hasn't rotated in admin panel
- Set SPF policy: change
~allto-all(hard fail) - Verify DKIM signature is valid (check with mail-tester)
- Set DMARC policy: start with
p=none, monitor, then upgrade - Configure Reverse DNS (PTR) — critical for deliverability
- Reduce email frequency (spam filter sees patterns)
- Verify mail.example.com A record exists
- Ensure port 80 is open (ACME challenge)
- Check CAA record (if present) includes letsencrypt.org
- Verify
acme_emailin config is valid
- Check SPF includes all sender IPs
- Verify DKIM signing enabled (admin panel shows key)
- Check email content (spam patterns, formatting)
- Verify recipient lists (no role accounts like postmaster@)
- Go to Hosted Zone
- Create record:
- Type: MX, Name: example.com, Value: 10 mail.example.com
- Type: TXT, Name: mail._domainkey.example.com, Value: v=DKIM1...
- DNS section
- Add record (Type, Name, Content)
- Leave proxy OFF for MX/TXT (gray cloud)
- DNS Management
- Points to table
- Add new record (Type, Host, Value, TTL)
- Domain → Manage → Nameserver → DNS Records
- Add record (Type, Host, Value, TTL)
- DKIM rotation: Rotate keys annually (admin panel: generate new key)
- SPF policy: Use
-all(hard fail) in production, start with~all(soft fail) - DMARC policy: Start
p=none, monitor, upgrade top=quarantineorp=reject - CAA records: Restrict to authorized CAs only
- PTR record: Configure reverse DNS (ask hosting provider)
- TLS: Enable MTA-STS to force TLS connections