<!-- https://www.gatehills.com/en/guides/mail-setup -->
# How to set up email with Google Workspace or Microsoft 365

**In short**

- Email setup adds the Google Workspace DNS records, or the Microsoft 365 ones, without typing them by hand.
- You find it in “My domains” → your domain → “DNS records” → “Set up email”.
- You see every change before it is applied, and you can undo the setup later.
- It is part of the free Gatehills DNS; the email service itself is paid to Google or Microsoft.

On Gatehills you add the Google Workspace DNS records or the Microsoft 365 DNS records from **DNS records** → **Set up email**. Choose the service, paste the verification value, check the preview and apply. MX, SPF, verification and DKIM are written in one step; the setup is free and you can undo it.

When you sign up for Google Workspace or Microsoft 365, the provider asks you to add DNS records so that email for `you@example.com` reaches their servers: **MX** records, an **SPF** record, a **verification** code and **DKIM** keys. The **Email setup** page builds these records for you from the official values, shows you exactly what changes in your zone, and applies everything in one step.

## What are MX, SPF, DKIM and DMARC records?

**Email DNS records in brief**

| Record | Type | What it does |
|---|---|---|
| MX | MX | Tells other mail servers where to deliver email for your domain |
| SPF | TXT | Lists the servers allowed to send email for your domain |
| Verification | TXT | Proves to Google or Microsoft that you control the domain |
| DKIM | TXT or CNAME | Publishes the key that signs your outgoing email |
| DMARC | TXT on \_dmarc | Tells receivers what to do with email that fails SPF and DKIM; p=none only collects reports |
| Autodiscover | CNAME | Lets Outlook find the Microsoft 365 settings by itself |

A domain must have only one SPF record (a rule of [RFC 7208](https://www.rfc-editor.org/rfc/rfc7208)). That is why the setup never adds a second one: it puts the new `include:` into the record you already have. If the SPF record needs more than the 10 DNS lookups allowed, the preview tells you.

![Google Workspace DNS records: the DNS records tab of example.com with the Set up email button and the choice between Google Workspace and Microsoft 365](https://www.gatehills.com/media/365-bc760afc832d.webp)
*1. the DNS records tab · 2. Set up email · 3. choose your email service*

## Set up Google Workspace or Microsoft 365

1. **Open the DNS records of your domain** Sign in, choose “My domains”, click the domain and open the “DNS records” tab (1).
2. **Open Email setup** In the box “Google Workspace or Microsoft 365?” click “Set up email” (2). The “Email setup” page opens.
3. **Choose your service** Under “Choose your email service” click “Google Workspace” or “Microsoft 365” (3).
4. **Paste the values from your provider** In “Verification record (optional)” paste the TXT value from the Google Admin console (“google-site-verification=…”) or from the Microsoft 365 admin center (“MS=ms…”). For Google you can also paste the “DKIM key (optional)”. For Microsoft you can paste the “MX record (optional)”, the two DKIM values (“DKIM selector1 (optional)” and “DKIM selector2 (optional)”) or “Or your initial onmicrosoft.com domain”, and tick Intune or Teams if you use them.
5. **Choose the options** Leave “Remove the other MX records (recommended)” ticked so that all email goes to the new service. Tick “Add a DMARC record (p=none) if there is none” if you want a basic DMARC record.
6. **Preview and apply** Click “Preview the changes”. The table “Changes to the zone” lists each record with “Add”, “Change” or “Remove” and the values “Now” and “After”. Read any warnings, then click “Apply the changes”. To start again, click “Change service”.
7. **Finish the verification** The records are published on our name servers within a few minutes. Go back to the admin console of Google or Microsoft and complete the verification of the domain there.

![The Google Workspace form with the verification record and options, the table of changes to the zone and the Apply the changes button](https://www.gatehills.com/media/366-2608fc8d2ff4.webp)
*1. verification record · 2. Preview the changes · 3. Changes to the zone · 4. Apply the changes*

## Which Google Workspace DNS records does the setup add?

**Records added by the setup**

| Service | MX | SPF (TXT) | Other records |
|---|---|---|---|
| Google Workspace | smtp.google.com, priority 1 | include:\_spf.google.com | Verification TXT, DKIM TXT (selector google unless you change it) |
| Microsoft 365 | example-com.mail.protection.outlook.com, priority 0 | include:spf.protection.outlook.com | Autodiscover CNAME, verification TXT, DKIM CNAME selector1 and selector2, optional Intune and Teams |

For Microsoft 365 the MX value is calculated from your domain (dots become hyphens). If the Microsoft 365 admin center shows a newer value ending in `.mx.microsoft`, paste it in **MX record (optional)**. A new SPF record is `v=spf1 include:_spf.google.com ~all` for Google and `v=spf1 include:spf.protection.outlook.com -all` for Microsoft. A DMARC record already in place is kept as it is.

## Undo the setup

On the **Email setup** page you see the last setup, when and by whom it was applied. Click **Undo this setup** and confirm to put back the previous records. Records you changed by hand after the setup are not touched.

## What does the preview warn you about?

Before anything changes, the preview lists the warnings for your zone:

- other MX records remain, so email may be split between two services;
- Gatehills email forwarding will be turned off, or stays on next to the new service;
- several SPF records were merged into one, or the SPF record needs more than 10 DNS lookups;
- a name is skipped because it has other records or is reserved;
- an existing value is replaced, or an existing DMARC record is kept.

When you click **Apply the changes**, the plan is calculated again on the records of that moment, so changes made in the meantime are not lost.

> **Common mistakes**
>
> - **Two SPF records**: a domain must have only one SPF record. The setup merges them for you; do not add a second one by hand.
> - **Old MX records left in place**: if you untick **Remove the other MX records (recommended)**, email may be split between the old and the new servers.
> - **Email forwarding still on**: if Gatehills email forwarding is active, the setup turns it off when it removes the other MX records. This also needs the email function on the account.
> - **Domain with hosting or other name servers**: the page explains why it is not available. With hosting, set up email in the hosting panel; with other name servers, add the records at your DNS provider.

### Do I need the verification code to start?

No, it is optional. You can apply the MX and SPF records first and run the setup again later with the verification and DKIM values: records already in place are not duplicated.

### How long until email works?

Our name servers are updated within a few minutes. Other networks may keep the old MX records until their TTL expires, usually within an hour.

### Will I lose my current emails?

The setup changes only DNS records. Messages already stored with your old provider stay there; new email is delivered to Google or Microsoft.

### Can I switch back to Gatehills email forwarding?

Yes: click **Undo this setup**, then check the **Email** tab. See [free email forwarding](/en/guides/email-forwarding).

### Why can I see the page but not apply changes?

You need the DNS function on the account. Ask the primary user; see [people and account](/en/guides/team-members).

**Related guides**

- [Manage the DNS records of your domain](/en/guides/dns-records)
- [Free email forwarding with your domain](/en/guides/email-forwarding)
- [Connect services automatically with Domain Connect](/en/guides/domain-connect)
- [Web hosting with cPanel](/en/guides/hosting)
