Latest v1.0.0

The CLI tool that automates DNS setup for MX, DKIM, DMARC, SPF and verification records

Quick Start

Set up
on

Tired of manually creating DNS records for email?

Never have to do it again!

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.

 

Commands

setup

Create DNS records for an email provider

mail2dns setup [options] <domain> <email-provider> <dns-provider>
Copied

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>
Copied

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>
Copied

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)

Ready to automate your email DNS?

Set up
on

Request a new provider

Don’t see your email or DNS provider? Let us know what we should support next. Your feedback helps us decide what to build.

If you provide your email, it will only be used to contact you about adding the provider.