The CLI tool that automates DNS setup for MX, DKIM, DMARC, SPF and verification records
Quick Start
Installation
npm install -g mail2dns Usage
mail2dns setup example.com ms365 cloudflare Tired of manually creating DNS records for email?
mail2dns is a CLI tool that automates the process of creating DNS records for email providers. With mail2dns, you can quickly generate the necessary records for your email service at your DNS provider, saving you time and reducing the risk of errors.
Run in interactive mode, where required inputs are provided via prompts, or in non-interactive mode using flags or environment variables — useful for scripts, automation, or infrastructure setup.
Supported Email Providers
Is your email provider missing? Let us know
Supported DNS Providers
Is your DNS provider missing? Let us know
Commands
setup
Create DNS records for an email provider
mail2dns setup [options] <domain> <email-provider> <dns-provider> Options
-o --no-mx Skip MX records (set up DNS for outbound email only) -n --skip-verify Skip domain verification step (use if domain is already verified) -y --yes Skip confirmation prompts (the command will error if any required inputs are missing) --allow-insecure-flags Allow secrets to be passed via command-line flags (not recommended) -d --dry-run Show records that would be created without applying them -z --zone <domain> DNS zone that contains the domain (overrides auto-detection) -p --dmarc-policy <policy> DMARC policy to use in the _dmarc TXT record (none, quarantine, reject) verify
Check that expected DNS records for an email provider are present via public DNS lookup
mail2dns verify [options] <domain> <email-provider> Options
-o --no-mx Skip MX records (verify DNS for outbound email only) -p --dmarc-policy <policy> Expected DMARC policy in the _dmarc TXT record (none, quarantine, reject) list
Show existing DNS records for a domain via the DNS provider API
mail2dns list [options] <domain> <dns-provider> Options
--allow-insecure-flags Allow secrets to be passed via command-line flags (not recommended) -z --zone <domain> DNS zone that contains the domain (overrides auto-detection)