Google Workspace Email: MX, SPF, DKIM, DMARC Setup
In this article
Yes, setting up Google Workspace email authentication—specifically configuring MX records, SPF, DKIM, and DMARC—is crucial for email deliverability and security. It helps prevent spammers and malicious actors from spoofing your domain and sending fraudulent emails. Here’s a detailed guide on how to do it.
What You'll Need
- Access to your domain registrar's DNS settings. This is where you manage your domain's DNS records (e.g., GoDaddy, Namecheap, Cloudflare).
- A Google Workspace account.
- Your Google Workspace administrator credentials.
Step-by-Step
- Set Up MX Records: MX (Mail Exchanger) records tell the internet where to deliver emails for your domain. Google provides specific MX records you need to add.
- Log in to your domain registrar's website.
- Navigate to the DNS management section for your domain.
- Look for existing MX records and delete them (unless you’re using a different email provider alongside Google Workspace – in which case, consult their documentation).
- Add the following MX records provided by Google:
- Priority: 1, Host: @ (or leave blank), Points to: ASPMX.L.GOOGLE.COM
- Priority: 5, Host: @ (or leave blank), Points to: ALT1.ASPMX.L.GOOGLE.COM
- Priority: 5, Host: @ (or leave blank), Points to: ALT2.ASPMX.L.GOOGLE.COM
- Priority: 10, Host: @ (or leave blank), Points to: ALT3.ASPMX.L.GOOGLE.COM
- Priority: 10, Host: @ (or leave blank), Points to: ALT4.ASPMX.L.GOOGLE.COM
- Save the changes. DNS propagation can take up to 48 hours, but is often much faster.
- Set Up SPF (Sender Policy Framework): SPF records specify which mail servers are authorized to send emails on behalf of your domain. This helps prevent spammers from forging your "From" address.
- Log in to your domain registrar's website and access the DNS management section.
- Create a new TXT record.
- Set the "Host" field to "@" (or leave blank).
- Set the "Value" (or "TXT Data") to:
v=spf1 include:_spf.google.com ~all. - Save the changes. This record essentially says “Only emails sent from Google's servers are authorized to use this domain.”
- Set Up DKIM (DomainKeys Identified Mail): DKIM adds a digital signature to your outgoing emails, allowing recipient servers to verify that the email truly came from your domain and hasn't been tampered with.
- In your Google Workspace admin console, go to Apps > Google Workspace > Gmail > Authenticate email.
- Select your domain.
- Click "Generate new record". You'll get a DKIM key (a long string of characters) and a TXT record value.
- Go back to your domain registrar's DNS settings.
- Create a new TXT record.
- Set the "Host" field to the value provided by Google Workspace (usually something like
google._domainkey). - Set the "Value" (or "TXT Data") to the long string of characters provided by Google Workspace.
- Save the changes. It can take up to 48 hours for Google to start using the DKIM key.
- Set Up DMARC (Domain-based Message Authentication, Reporting & Conformance): DMARC builds upon SPF and DKIM, telling recipient servers what to do with emails that fail authentication checks. It also allows you to receive reports about email authentication failures.
- Log in to your domain registrar's website and access the DNS management section.
- Create a new TXT record.
- Set the "Host" field to
_dmarc. - Set the "Value" (or "TXT Data") to:
v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com; ruf=mailto:forensic-reports@yourdomain.com; adkim=r; aspf=r. Replaceyourdomain.comwith your actual domain. - Save the changes.
- Explanation of DMARC tags:
v=DMARC1: Specifies the DMARC version.p=none: Initially set this to "none" to monitor reports without impacting email delivery. Later, you can change it to "quarantine" or "reject" to instruct recipient servers how to handle failing emails.rua=mailto:dmarc-reports@yourdomain.com: Specifies the email address where aggregate DMARC reports should be sent.ruf=mailto:forensic-reports@yourdomain.com: Specifies the email address where forensic (failure) reports should be sent.adkim=r: Alignment mode for DKIM (relaxed).aspf=r: Alignment mode for SPF (relaxed).
Common Mistakes
- Incorrect MX Record Priority: Ensure the MX record priorities are set correctly as specified by Google. Incorrect priorities can lead to delivery issues.
- Missing or Incorrect SPF Record: A missing or incorrectly configured SPF record can lead to emails being flagged as spam.
- DKIM Key Mismatch: Double-check that the DKIM key in your DNS record matches the key generated in your Google Workspace admin console.
- DMARC Tag Errors: Typos or incorrect values in your DMARC record can prevent it from working correctly.
- Forgetting DNS Propagation: Remember that DNS changes can take time to propagate across the internet. Be patient and allow up to 48 hours for the changes to take effect.
- Conflicting Records: Make sure there aren't any conflicting SPF or TXT records that could interfere with DMARC.
Tips
- Start with `p=none` in DMARC: Begin with a policy of "none" to monitor your email traffic and identify any legitimate senders that are failing authentication.
- Monitor DMARC Reports: Regularly check your DMARC reports to identify and address any authentication failures.
- Gradually Harden Your DMARC Policy: Once you're confident that your email authentication is working correctly, gradually increase the strictness of your DMARC policy (from "none" to "quarantine" to "reject").
- Use a DNS Checker Tool: After making changes, use a DNS checker tool (like MXToolbox or What’s My DNS) to verify that your DNS records are propagating correctly.
- Keep Records Updated: Regularly review and update your DNS records to ensure they are accurate and secure.
Troubleshooting
- Email Delivery Issues: If you're experiencing email delivery problems, first check your MX records to ensure they are configured correctly. Then, verify your SPF and DKIM records.
- Emails Marked as Spam: If your emails are being marked as spam, review your SPF, DKIM, and DMARC records to identify any potential issues.
- DMARC Reports Not Received: If you're not receiving DMARC reports, double-check your
ruatag in your DMARC record and ensure that your email server is not blocking these reports. - DNS Propagation Issues: If your DNS records are not propagating correctly, try clearing your DNS cache and waiting a few hours.
- Incorrect DNS Settings: Carefully review the DNS settings at your domain registrar to ensure there are no typos or errors.
- Restart and Recheck: As a general troubleshooting step, try restarting your computer and rechecking all the settings.