Prompt
How do I send emails from multiple subdomains safely?
Latest observation
Sending email from multiple subdomains safely is mostly about authentication, alignment, and isolation. A good setup keeps each subdomain trustworthy on its own, while protecting your main domain reputation.
1) Use a clear domain strategy
Decide what each subdomain is for, for example:
news.example.com— marketing newslettersbilling.example.com— invoices/receiptssupport.example.com— transactional support mail
This helps separate reputation and makes DNS easier to manage.
2) Set up SPF for each sending subdomain
Create an SPF record for each subdomain that sends mail.
Example:
news.example.com. TXT "v=spf1 include:your-esp.example -all"
billing.example.com. TXT "v=spf1 include:your-esp.example -all"
Tips:
- Only authorize the servers/services that actually send for that subdomain.
- Avoid overly broad includes.
- Keep the SPF lookup count under the DNS limit.
3) Sign mail with DKIM per subdomain
Use DKIM signatures aligned to the subdomain.
Example:
d=news.example.comd=billing.example.com
Best practice:
- Use separate DKIM keys for each subdomain.
- Rotate keys periodically.
- Keep private keys secure in your mail platform or HSM/secrets manager.
4) Publish DMARC on each sending subdomain
DMARC is what ties SPF/DKIM to the visible “From” domain and tells receivers how to handle failures.
Example:
_dmarc.news.example.com. TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc-reports@example.com; adkim=s; aspf=s"
Recommended:
- Start with
p=noneif you’re unsure and want reports first. - Move to
quarantine, thenrejectonce everything passes. - Use strict alignment if you want maximum protection:
adkim=saspf=s
5) Separate reputation by purpose
Don’t mix high-risk and low-risk mail streams.
Good separation:
- marketing on one subdomain
- transactional on another
- internal/system alerts on another
Benefits:
- A spam complaint spike on newsletters won’t hurt password reset emails as much.
- Easier troubleshooting and analytics.
6) Use dedicated IPs or sending pools if volume is significant
If you send enough mail, use:
- separate dedicated IPs per stream, or
- separate IP pools in your ESP
This protects reputation further and gives better control over deliverability.
7) Set up TLS and secure outbound relays
Make sure:
- your ESP or SMTP relay supports STARTTLS
- your app uses authenticated SMTP or API keys
- secrets are stored securely
- restrict who can send through each identity
8) Protect against spoofing
For each subdomain:
- publish DMARC
- reject unauthorized mail
- ensure
From:domain matches the authenticated domain - don’t let apps send “from” a subdomain unless they are explicitly permitted
9) Monitor reports and logs
Watch:
- DMARC aggregate reports
- SPF/DKIM pass rates
- bounce rates
- complaint rates
- unusual send patterns
This helps catch:
- misconfigured DNS
- forwarded mail issues
- abuse or compromised credentials
10) Example safe pattern
If you own example.com:
example.com→ brand/websitenews.example.com→ marketingmail.example.com→ transactionalalerts.example.com→ system alerts
For each one:
- SPF: authorize only the relevant sender
- DKIM: unique selector/key per subdomain
- DMARC: policy and reports per subdomain
- Separate tracking domains if needed for marketing links/pixels
11) Common mistakes to avoid
- Using the same sender domain for everything
- Authorizing too many systems in SPF
- Sharing DKIM keys across environments
- Skipping DMARC
- Sending mail from a subdomain without matching DNS records
- Not monitoring complaint/bounce/reputation data
Quick recommendation
If you want the safest practical setup:
- Create a separate subdomain for each mail stream
- Set SPF for each subdomain
- Sign with DKIM using aligned subdomain keys
- Publish DMARC with reporting
- Use separate IPs/pools if volume is meaningful
- Monitor reports and gradually tighten policy to
reject
If you want, I can also give you:
- a sample DNS setup for
news.example.comandbilling.example.com, or - a step-by-step configuration for a specific provider like SES, SendGrid, Mailgun, Postmark, or Google Workspace.