Setting Up DNS Records for Email: A Step-by-Step Guide

May 2026 · 9 min read

Properly configuring DNS records is essential for email delivery. Whether you're setting up a new mail server or migrating to a new email host, you need four types of DNS records: MX, SPF, DKIM, and DMARC. Here's how to set up each one.

Step 1: MX Records (Mail Exchange)

MX records tell other mail servers where to deliver email for your domain. Without them, no one can send you email.

yourdomain.com    MX    10    mail.yourdomain.com

The number (10) is the priority. Lower numbers have higher priority. If you have multiple mail servers, use different priorities for failover.

Step 2: SPF Record (Sender Policy Framework)

SPF tells receiving servers which IPs are authorised to send email for your domain. It's a TXT record on your root domain.

yourdomain.com    TXT    "v=spf1 mx include:_spf.yourprovider.com -all"

Key rules:

Step 3: DKIM Record (DomainKeys Identified Mail)

DKIM adds a cryptographic signature to your emails. You need to publish the public key in DNS. Your email provider will give you the specific record.

selector._domainkey.yourdomain.com    TXT    "v=DKIM1; k=rsa; p=MIIBIjANBg..."

The selector is unique to your provider (e.g., netcob, google, mail). Your provider will tell you exactly what to use.

Step 4: DMARC Record

DMARC ties SPF and DKIM together with a policy and enables reporting.

_dmarc.yourdomain.com    TXT    "v=DMARC1; p=reject; rua=mailto:dmarc@yourdomain.com"

Start with p=none (monitoring mode) if you're not confident in your setup. Move to p=quarantine and then p=reject once you've confirmed everything works.

Provider-Specific Instructions

Cloudflare

  1. Log in to the Cloudflare dashboard
  2. Select your domain → DNS → Records
  3. Click "Add record" for each record type
  4. For MX: Set Name to @, Content to your mail server, Priority as specified
  5. For TXT records: Set Name to @ (SPF/DMARC) or the specific subdomain (DKIM)

GoDaddy

  1. Go to My Products → DNS → Manage
  2. Under Records, click "Add" for each record
  3. Select the record type (MX or TXT)
  4. Enter the host, value, and priority as specified

Namecheap

  1. Log in → Domain List → Manage → Advanced DNS
  2. Click "Add New Record"
  3. Select the type and enter the host and value

Verifying Your Setup

After adding your DNS records, verify them using these tools:

DNS changes can take up to 48 hours to propagate, though most complete within 1-4 hours.

Skip the DNS hassle

Netcob's guided setup wizard tells you exactly which records to add, and auto-configures them if your domain is on Cloudflare.

Start Free Trial →