DMARC and SPF Record Generator (Free)

Build the DNS records that keep your emails out of spam folders.

Create a DMARC record and a matching SPF record for your domain in a minute. Pick the services that send email for you, choose a DMARC policy and copy TXT records ready to paste into your DNS.

Who sends email for your domain?
    Embed this tool on your site

    Free to use. Paste this code into a Custom HTML block or any web page and keep the credit line under it.

    Advertisement

    Why these records matter now

    Since 2024, Gmail and Yahoo require anyone sending in bulk to authenticate their email with SPF, DKIM and DMARC. Even small senders see the difference: authenticated mail lands in the inbox far more often, and without a DMARC record anyone can send email that claims to be from your domain.

    • SPF lists the servers allowed to send email for your domain.
    • DKIM adds a signature to each email. Your email provider gives you this record; it can’t be generated here because the key comes from them.
    • DMARC tells receiving servers what to do when an email fails those checks, and sends you reports.

    Building your SPF record

    Tick every service that sends email using your domain: your mailbox provider (Google Workspace, Microsoft 365, Hostinger and so on), your newsletter tool and any transactional service such as SendGrid or Amazon SES. Then add these points to your checklist:

    • You can only have one SPF record. If one exists, replace it with the combined version.
    • SPF allows at most 10 DNS lookups. Every include, a and mx counts, and includes can contain more lookups inside them. Remove services you no longer use.
    • End with ~all while you are getting set up. Switch to -all only when you are certain every sender is listed.

    Rolling out DMARC safely

    Start with p=none and a reporting address. Nothing changes for your email, but you start receiving daily reports showing which servers send as your domain and whether they pass. After two to four weeks of clean reports, move to p=quarantine, and later to p=reject. Going straight to reject is the fastest way to lose real emails, such as invoices sent by a billing tool you forgot about.

    DMARC record tags explained

    A DMARC record is one line of text made of tags separated by semicolons. Only v and p are required. The generator fills in the rest for you, but it helps to know what each part does when you read someone else’s record or a report.

    TagWhat it meansTypical value
    vVersion. Must come first.DMARC1
    pPolicy for mail that fails: do nothing, send to spam, or block.none, quarantine or reject
    spPolicy for subdomains, if different from the main policy.Often left out, so subdomains follow p
    ruaWhere daily aggregate reports are sent.mailto:[email protected]
    rufWhere failure (forensic) reports go. Few providers send these.Optional
    adkim / aspfAlignment mode for DKIM and SPF: relaxed lets a subdomain match, strict needs an exact match.r (relaxed, the default)
    pctPercentage of failing mail the policy applies to, useful for a gradual move to quarantine.100 (the default)
    foWhen failure reports are generated.1 if you use ruf

    Example DMARC records you can copy

    Replace yourdomain.com with your own domain and add the record as a TXT record with the host _dmarc.

    • Monitoring only (start here): v=DMARC1; p=none; rua=mailto:[email protected]
    • Quarantine a quarter of failing mail while you test: v=DMARC1; p=quarantine; pct=25; rua=mailto:[email protected]
    • Full protection: v=DMARC1; p=reject; rua=mailto:[email protected]
    • A domain that never sends email (for example a parked domain): v=DMARC1; p=reject; together with the SPF record v=spf1 -all

    The reports arrive as zipped XML files, which are hard to read by hand. Free report readers from services such as Postmark, dmarcian or your email provider turn them into a simple list of who sends as your domain. Use a separate mailbox for rua if you send a lot of email, because big senders can generate dozens of reports a day.

    How to check that your DMARC record works

    Once the record is saved, look it up from your own computer. On Windows, open Command Prompt and run nslookup -type=txt _dmarc.yourdomain.com. On a Mac or Linux, run dig txt _dmarc.yourdomain.com. You should see the exact text you added. If nothing comes back, the host name is usually the problem: some DNS panels add your domain automatically, so entering _dmarc.yourdomain.com creates _dmarc.yourdomain.com.yourdomain.com.

    A second check is to send an email to a Gmail address, open it, choose “Show original” from the three-dot menu and look for SPF: PASS, DKIM: PASS and DMARC: PASS at the top.

    Adding the records

    Log in wherever your DNS is managed: your domain registrar, your host or Cloudflare. Add a TXT record with the host and value shown above. Changes usually work within an hour, though some providers take up to 48 hours. Our SPF, DKIM and DMARC setup guide for newsletter senders shows where to find each setting.

    Common questions

    Do I need DMARC if I only send a few emails?

    It is still worth it. A DMARC record with p=none costs nothing, protects your domain from being spoofed and gives receiving servers one more reason to trust your mail.

    What should the DMARC host be?

    Use _dmarc as the host or name. Some DNS panels want the full _dmarc.yourdomain.com; the generator shows the short form most panels expect.

    Can I have two SPF records?

    No. Two SPF records make SPF fail completely. Merge all your includes into one record, which is what this generator does.

    Can DMARC work without SPF?

    Technically yes. DMARC passes when either SPF or DKIM passes and lines up with the domain in the From address, so a message signed with a valid DKIM key can pass with no SPF record at all. In practice you should set up both. Forwarded emails often break SPF, and DKIM keys can fail after a provider change, so having both gives DMARC two chances to pass.

    Is this DMARC generator free?

    Yes, with no sign-up. The records are built in your browser, so your domain and settings are not sent to us.

    Where do I get my DKIM record?

    From each service that sends for you. Google Workspace, Microsoft 365, Brevo, Mailchimp and others each have a DKIM page in their settings with the exact record to add.

    Advertisement