To configure SPF, DKIM and DMARC in Namecheap DNS, you add three kinds of TXT record in Advanced DNS. You need one SPF record on @, one DKIM record for each service that sends your mail, and one DMARC record on _dmarc. Together they prove to Gmail, Yahoo and Outlook that mail from your domain is really yours, which keeps it out of spam and stops 550 rejections.
Quick answer: Publish exactly one SPF record, a DKIM key from each sending service, and a DMARC record that starts in monitoring mode.
- Confirm the domain uses Namecheap BasicDNS; otherwise edit records at your real DNS host.
- Add one SPF TXT record on
@listing every service that sends your mail. - Generate a DKIM key in your email provider and add it on
selector._domainkey. - Add a DMARC TXT record on
_dmarcwithp=none. - Check all three with
dig, then send a test to Gmail and look for PASS.
In this guide

Before You Start
- Access: your Namecheap login and admin access to each email service that sends as your domain (Google Workspace, Microsoft 365, Namecheap Private Email, SendGrid and so on). Each one gives you its SPF include and DKIM key.
- List every sender: your inbox provider, newsletter tool, app or transactional mail, help desk and CRM. A sender missing from SPF and DKIM fails checks once DMARC is enforced.
- Back up: take a screenshot of the Advanced DNS page and copy any existing
v=spf1record before you change it. - Check your DNS host: run
dig +short NS example.com. If it does not printdns1.registrar-servers.com.anddns2.registrar-servers.com., your records live elsewhere (Cloudflare or your web host, for example), and editing Namecheap’s Advanced DNS tab does nothing. - Time: about 20 to 30 minutes. New records usually show up within 30 minutes.
- Email warning: a wrong SPF or DMARC record can push your own mail into spam. That is why DMARC starts at
p=nonebelow.
If you recently moved hosts, first confirm your MX records still point at your mail provider. Our guide to point Namecheap DNS to Hostinger without breaking email shows how to check them.
What SPF, DKIM and DMARC Do
Google and Yahoo apply strict sender rules to custom domains. Receiving servers treat mail they cannot authenticate as possible phishing, so it lands in spam or is rejected. Three records handle the authentication:
- SPF (Sender Policy Framework): a TXT record listing the servers and IP addresses allowed to send mail for your domain.
- DKIM (DomainKeys Identified Mail): a public key in DNS that matches the digital signature your provider adds to every outgoing message.
- DMARC (Domain-based Message Authentication, Reporting, and Conformance): a policy record telling receivers what to do (monitor, quarantine or reject) when SPF or DKIM fails, and where to send reports.
Here is what the finished set looks like in Namecheap. Your SPF includes, DKIM selector and key come from your own providers:
| Record | Type | Host | Value (example) | TTL |
|---|---|---|---|---|
| SPF | TXT Record | @ |
v=spf1 include:_spf.google.com ~all |
Automatic |
| DKIM | TXT Record (or CNAME Record) | google._domainkey (your selector) |
v=DKIM1; k=rsa; p=… from your provider |
Automatic |
| DMARC | TXT Record | _dmarc |
v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com |
Automatic |
Step 1: Add One SPF Record in Namecheap
The most common SPF mistake is publishing more than one SPF record. Under RFC 7208 (SPF Specification), your domain must have exactly one. With two v=spf1 records, SPF evaluation returns a PermError, which receivers treat as a failure for every message you send.
- In Namecheap, open Domain List and click Manage next to your domain.
- Open the Advanced DNS tab.
- Look through Host Records for TXT records that start with
v=spf1. Keep one and delete any stale copies. - Click Add New Record (or edit the existing one) and save with the green checkmark.
A basic Google Workspace SPF record looks like this in Namecheap:
Type: TXT Record
Host: @
Value: v=spf1 include:_spf.google.com ~all
TTL: AutomaticIf more than one service sends your mail, for example Google Workspace for team inboxes and SendGrid or Amazon SES for app notifications, merge them into the same record with several include: tags:
Type: TXT Record
Host: @
Value: v=spf1 include:_spf.google.com include:sendgrid.net ~all
TTL: AutomaticKeep the total number of DNS lookups under 10. Every include: triggers at least one lookup behind the scenes. Cross the limit and receivers fail the check with a PermError. For the exact include values for Google Workspace, see our guide to Google Workspace email with Namecheap DNS.
Step 2: Generate and Add Your DKIM Record
DKIM uses a key pair. Your email provider keeps the private key and signs each message with it. Namecheap only hosts the public key, so receiving servers can look it up and check the signature.
Your provider gives you two pieces of data: a selector (the name of the key) and the public key value.
- Log in to your email provider’s admin console and generate a 2048-bit DKIM key (use 1024-bit only if your provider doesn’t support 2048-bit).
- Note down the selector (e.g.,
google,k1, ors1). - In Namecheap Advanced DNS, click Add New Record.
- Choose TXT Record, or CNAME Record if your provider uses CNAME-based DKIM (SendGrid and Amazon SES do).
- In Host, enter the selector followed by
._domainkey, without your domain name.
With Google Workspace and the selector google, the record looks like this:
Type: TXT Record
Host: google._domainkey
Value: v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0...
TTL: AutomaticSome providers only start signing after you confirm the record in their console. In Google Workspace, return to the DKIM page once the record is live and click Start authentication. For marketing and automation platforms that use their own selectors, see how to set up a dedicated email sending domain.
Long 2048-Bit Keys and the 255-Character Limit
A 2048-bit DKIM key runs to about 400 characters. DNS limits a single TXT string to 255 characters, so a long key is published as several quoted strings inside one record, and receivers join them back together.
Namecheap’s TXT value field accepts up to 2,500 characters, so paste the whole key as one line, with no quotation marks and no line breaks. Two related points:
- If your email provider supports CNAME delegation (pointing
s1._domainkey.example.comto their managed host), use a CNAME Record instead. The provider hosts the key, so the TXT length limit never comes into it. - If you manage DNS at a host that rejects values over 255 characters, split the key into two double-quoted segments separated by a single space:
Host: google._domainkey
Value: "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy1...FIRST_HALF" "SECOND_HALF_STRING_HERE...IDAQAB"After saving, query Namecheap’s nameserver directly: dig TXT google._domainkey.example.com @dns1.registrar-servers.com +short. Seeing the key come back as two quoted chunks is normal. What matters is that joining them gives exactly the key your provider generated.
Step 3: Publish a Safe DMARC Policy
DMARC tells receiving servers what to do when a message fails both SPF and DKIM alignment. Never start with a reject policy. If you forgot a tool that sends on your behalf, its legitimate mail would be dropped.
Start with a monitoring policy (p=none). Receivers then send you aggregate reports, and you can spot senders that still fail:
Type: TXT Record
Host: _dmarc
Value: v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com; sp=none; aspf=r; adkim=r
TTL: AutomaticIn Namecheap Advanced DNS:
- Host: enter
_dmarc. Do not add your domain name; Namecheap appends it automatically. - Value: paste the DMARC string and replace
dmarc-reports@example.comwith your reporting mailbox or a DMARC report service address. - TTL: Automatic or 30 minutes (1800 seconds).
After a week or two of reports with no legitimate failures, move to p=quarantine (failing mail goes to spam), and later to p=reject (failing mail is refused outright):
Host: _dmarc
Value: v=DMARC1; p=reject; pct=100; rua=mailto:dmarc-reports@example.comStep 4: Verify the Records from Your Terminal
Check what DNS actually returns instead of trusting a dashboard. Run these dig commands in a terminal on your own computer, replacing example.com and the selector with yours:
# Check SPF Record
dig TXT example.com +short
# Check DKIM Record (replace 'google' with your selector)
dig TXT google._domainkey.example.com +short
# Check DMARC Record
dig TXT _dmarc.example.com +shortA correct setup returns lines like these:
"v=spf1 include:_spf.google.com ~all"
"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBC..."
"v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com; sp=none; aspf=r; adkim=r"The first query also prints any other TXT records on your root domain, such as verification codes. That is normal; just make sure only one line starts with v=spf1. On Windows, use nslookup -type=TXT _dmarc.example.com 8.8.8.8 for the same check.
For a browser-based check, enter your domain in the dmarcian DMARC Inspector and compare the results with the Google Email Sender Guidelines.
If It Still Doesn’t Work
If your records still don’t show up or still fail after 30 minutes, check these Namecheap-specific causes:
- Full domain typed in the Host field: entering
_dmarc.example.comcreates a record at_dmarc.example.com.example.com. Enter only_dmarcorselector._domainkey, and@for root records like SPF. - Duplicate SPF records: your web host may have auto-generated an SPF record. Delete it and merge its
include:into your single record. - Trailing semicolon in SPF: semicolons belong in DKIM and DMARC values, never SPF.
v=spf1 ... ~all;breaks SPF parsing on strict receivers. - DKIM record live but messages still unsigned: the provider has not started signing. Turn DKIM on in its console (in Google Workspace, Start authentication).
- Nothing changes at all: the domain uses other nameservers. Run the
dig +short NScheck from Before You Start and edit the records at that DNS host.
Frequently Asked Questions
How long does Namecheap take to publish TXT records?
Usually 5 to 30 minutes with the TTL set to Automatic or 1 minute. If you edited an existing record, resolvers that cached the old value keep it until its previous TTL expires, which can take up to 24 hours on long TTLs. New records have no cached copy, so they appear fastest.
Can I have multiple DKIM records on one domain?
Yes. Unlike SPF, you can publish as many DKIM records as you need. Each sending platform uses its own selector, such as google._domainkey or s1._domainkey, so the records live at different names and never conflict. Add one for every service that signs mail as your domain.
Should I use ~all or -all in my SPF record?
Start with ~all (SoftFail) while you set things up. Once every sending service is in the record and DKIM passes consistently, you can switch to -all (HardFail). With DMARC enforcing, the difference matters less, because DMARC decides what happens to failing mail.
Why does my DMARC test say alignment failed?
The domain in the visible “From:” address must match the domain that passed SPF (the Return-Path) or DKIM (the d= tag in the signature). If mail says it is from user@example.com but DKIM is signed for sendgrid.net, alignment fails. Set up domain authentication in that service so it signs as your domain.
Do I need DMARC to send email to Gmail?
If you send in bulk, yes. Google requires bulk senders to publish a DMARC record, and every sender needs at least SPF or DKIM. A p=none record meets the DMARC requirement, which is why it is the safe first step. Check the Google Email Sender Guidelines linked above for the current rules.
Next Steps
- Send a test email to a personal Gmail account.
- Open the message, click the three vertical dots in the top-right corner, and select Show original.
- Confirm that SPF, DKIM and DMARC all show PASS.
- Read your DMARC reports for one to two weeks, fix any sender that fails, then tighten the policy to
p=quarantine.
If you use Namecheap Private Email, check that your MX and SPF values match our Namecheap Private Email MX records guide.

