This repository contains comprehensive documentation and tools for configuring DNS records for mail domains Mail.bad.mn and Mail.Newera.sbs.
dns_mail_configuration.md
- Complete DNS configuration guide with all required recordsdns_configuration_checklist.md
- Step-by-step implementation checklistimport_files_documentation.md
- Python import system documentation (from DOT project analysis)
dns_configuration_script.py
- Python script for generating and validating DNS configurationsvalidate_dns.sh
- Bash script for automated DNS validation and testing
Before starting, ensure you have:
- Mail server set up with static IP
- Access to DNS management panels
- Required tools installed:
dig
,python3
# Edit the script with your actual IP addresses and DKIM keys
python3 dns_configuration_script.py
Use dns_configuration_checklist.md
for step-by-step implementation.
# Make script executable (first time only)
chmod +x validate_dns.sh
# Test all domains
./validate_dns.sh
# Test specific domain
./validate_dns.sh -d bad.mn
- A Records: Point domains and mail subdomains to IP addresses
- MX Records: Define mail exchange servers
- SPF: Prevent email spoofing
- DKIM: Digital signature verification
- DMARC: Domain-based message authentication policy
- CAA: Certificate authority authorization
bad.mn. A YOUR_WEB_SERVER_IP
mail.bad.mn. A YOUR_MAIL_SERVER_IP
bad.mn. MX 10 mail.bad.mn.
bad.mn. TXT "v=spf1 mx a:mail.bad.mn ip4:YOUR_MAIL_SERVER_IP ~all"
default._domainkey.bad.mn. TXT "v=DKIM1; k=rsa; p=YOUR_DKIM_PUBLIC_KEY"
_dmarc.bad.mn. TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@bad.mn"
newera.sbs. A YOUR_WEB_SERVER_IP
mail.newera.sbs. A YOUR_MAIL_SERVER_IP
newera.sbs. MX 10 mail.newera.sbs.
newera.sbs. TXT "v=spf1 mx a:mail.newera.sbs ip4:YOUR_MAIL_SERVER_IP ~all"
default._domainkey.newera.sbs. TXT "v=DKIM1; k=rsa; p=YOUR_DKIM_PUBLIC_KEY"
_dmarc.newera.sbs. TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc@newera.sbs"
# Basic DNS tests
dig A bad.mn
dig A mail.bad.mn
dig MX bad.mn
dig TXT bad.mn
# Security record tests
dig TXT default._domainkey.bad.mn
dig TXT _dmarc.bad.mn
# Reverse DNS test
dig -x YOUR_MAIL_SERVER_IP
# Run comprehensive validation
./validate_dns.sh
# Generate configuration files
python3 dns_configuration_script.py
- Set up A and MX records
- Test basic connectivity
- Configure SPF, DKIM, DMARC
- Start with monitoring mode
- Add CAA records
- Configure SRV records (optional)
- Contact hosting provider
- Set up PTR records
- Use provided scripts
- Manual testing
- DNS propagation checks
- Send/receive test emails
- Check deliverability scores
- Review DMARC reports
- Gradually tighten security policies
Before implementation, replace these placeholders:
YOUR_MAIL_SERVER_IP
- Your mail server's public IPYOUR_WEB_SERVER_IP
- Your web server's IP (can be same as mail)YOUR_DKIM_PUBLIC_KEY
- Generated DKIM public keyYOUR_NS1_IP
/YOUR_NS2_IP
- Name server IPs (if self-hosting DNS)
- DNS not propagating - Wait 24-48 hours, check multiple DNS servers
- Emails going to spam - Verify SPF, DKIM, DMARC, reverse DNS
- Cannot receive emails - Check MX records and firewall settings
- DKIM failing - Verify key format and mail server configuration
- Use
./validate_dns.sh
for automated checking - Check MXToolbox.com for comprehensive testing
- Use Mail-tester.com for deliverability scoring
- Cloudflare DNS
- Route 53 (AWS)
- Google Cloud DNS
- Traditional registrar DNS panels
- Postfix + Dovecot
- Microsoft Exchange
- Zimbra
- iRedMail
- DMARC Analyzer
- Postmaster Tools (Google)
- Mail delivery monitoring services
- Start Conservative: Use
~all
for SPF andp=none
for DMARC initially - Monitor First: Review DMARC reports before hardening
- Gradual Hardening: Progressively tighten policies
- Regular Rotation: Rotate DKIM keys annually
- Continuous Monitoring: Set up alerts for mail delivery issues
For issues or questions:
- Check the troubleshooting section in
dns_mail_configuration.md
- Run validation scripts for diagnostic information
- Consult your DNS provider's documentation
- Contact your hosting provider for reverse DNS setup
This documentation and tooling is provided as-is for educational and implementation purposes. Adapt to your specific requirements and security policies.
Remember: DNS changes can take 24-48 hours to propagate globally. Always test thoroughly before going into production!