How to Set Up Gmail with a Custom Domain Name

Complete guide to configuring Gmail with your own domain through Google Workspace. Covers MX records, SPF, DKIM, DMARC, and DNS setup.

domain email gmail

How to Set Up Gmail with a Custom Domain Name

Using Gmail with your own domain means sending and receiving email at [email protected] while keeping the Gmail interface, spam filtering, and ecosystem you already know. Google Workspace (formerly G Suite) is the product that makes this possible.

This guide covers the full setup: creating your Workspace account, configuring DNS records, enabling authentication, and verifying everything works.

Prerequisites

Before you begin, you need:

  • A registered domain name with access to its DNS settings.
  • A Google Workspace subscription (plans start at Business Starter).
  • Administrative access to your domain registrar or DNS hosting provider.

Step 1: Sign Up for Google Workspace

Go to workspace.google.com and start the signup process. You will provide your domain name, create your first admin user (e.g., [email protected]), and select a plan. Google offers a trial period for new accounts.

During signup, Google will ask you to verify domain ownership. The most common method is adding a TXT record to your DNS zone:

@ TXT "google-site-verification=your-unique-code"

Add this record at your registrar, wait for propagation, and click Verify in the Workspace admin console.

Step 2: Configure MX Records

MX records tell the internet where to deliver mail for your domain. Replace any existing MX records with Google's:

Priority Mail Server
1 ASPMX.L.GOOGLE.COM
5 ALT1.ASPMX.L.GOOGLE.COM
5 ALT2.ASPMX.L.GOOGLE.COM
10 ALT3.ASPMX.L.GOOGLE.COM
10 ALT4.ASPMX.L.GOOGLE.COM

Remove old MX records that point to previous email providers to avoid split delivery. After saving, use the InboxTooling MX Lookup to confirm the records have propagated and are correctly prioritized.

Step 3: Set Up SPF

SPF (Sender Policy Framework) tells receiving servers which IPs are authorized to send mail for your domain. Add a TXT record at the root of your zone:

@ TXT "v=spf1 include:_spf.google.com ~all"

If you have other services that also send email on behalf of your domain (marketing platforms, transactional services), include them in the same record:

@ TXT "v=spf1 include:_spf.google.com include:sendgrid.net ~all"

Validate your SPF record with the InboxTooling SPF Check to make sure it parses correctly and does not exceed the 10 DNS lookup limit.

Step 4: Enable DKIM Signing

DKIM adds a cryptographic signature to every outgoing message, allowing recipients to verify the message was not altered in transit.

  1. In the Google Workspace Admin console, go to Apps > Google Workspace > Gmail > Authenticate email.
  2. Select your domain.
  3. Click Generate new record. Choose a 2048-bit key if your DNS provider supports it.
  4. Google will give you a CNAME or TXT record to add at your DNS provider. The selector is typically google and the record looks like:
google._domainkey TXT "v=DKIM1; k=rsa; p=MIIBIjANBg..."
  1. Add the record, wait for propagation, then click Start authentication in the admin console.

After enabling, verify the record is published correctly using the InboxTooling DKIM Verify tool.

Step 5: Publish a DMARC Policy

DMARC ties SPF and DKIM together and tells receiving servers what to do when authentication fails. Start with a monitoring-only policy:

_dmarc TXT "v=DMARC1; p=none; rua=mailto:[email protected]"

This sends aggregate reports to the address you specify without affecting mail delivery. Once you have reviewed reports and confirmed all legitimate sending sources pass SPF and DKIM, move to a stricter policy:

_dmarc TXT "v=DMARC1; p=reject; rua=mailto:[email protected]"

Use the InboxTooling DMARC Analyzer to validate your record syntax and policy configuration.

Step 6: Create User Accounts and Migrate Email

In the Workspace Admin console, create accounts for each user. If you are migrating from another provider, Google provides a data migration tool under Account > Data migration. It supports migration from:

  • Microsoft Exchange / Office 365
  • IMAP-based servers
  • Other Google Workspace accounts

For large migrations, consider using the Google Workspace Migration for Microsoft Exchange (GWMME) tool for more granular control.

Step 7: Verify Everything

Once DNS changes have propagated (allow up to 48 hours, though most changes take effect within an hour), run a comprehensive check:

  1. MX Lookup -- confirm Google's MX servers are returned with correct priorities.
  2. SPF Check -- verify the SPF record includes Google and any other senders.
  3. DKIM Verify -- ensure the DKIM public key is published.
  4. DMARC Analyzer -- confirm DMARC is active and the policy is as intended.

Send a test email from your new address to an external account and inspect the headers to confirm DKIM signatures are present and SPF passes.

Common Issues

  • Mail still going to old provider: Old MX records may be cached. Reduce TTL before migrating, and remove legacy MX records entirely.
  • SPF failures for third-party senders: Every service that sends as your domain needs to be included in the SPF record.
  • DKIM not signing: Make sure you clicked "Start authentication" in the admin console after adding the DNS record.
  • DMARC reports not arriving: Double-check the rua address and ensure the mailbox exists.

Gmail-Specific Deliverability Notes

Google Workspace accounts benefit from Google's sender reputation infrastructure, but you still need proper authentication. Gmail, Outlook, and Yahoo all enforce DMARC policies. As of 2024, Gmail and Yahoo require bulk senders to have valid SPF, DKIM, and DMARC records -- even for Workspace customers sending to those platforms.


Stay on top of your email infrastructure. Sign up for the InboxTooling newsletter for deliverability tips, tool updates, and best practices.