2026-10-04
google-workspace
gmail
custom-domains
setup-guide
dns

Use Anjal on a Domain That Already Runs Google Workspace

Use Anjal on a Domain That Already Runs Google Workspace

If your business already runs on Google Workspace, you do not have to give up Gmail to put an AI agent on email. You can keep Gmail for your team and add Anjal inboxes on the same domain, so your agent can be agent@yourcompany.com while you stay you@yourcompany.com.

Anjal calls this a shared domain. This guide shows how it works, what to change, and what to watch for.

How it works

Normally, adding a domain to Anjal means pointing its MX record at Anjal. That is the wrong move for a domain that already receives mail at Google, because it would send all your team's mail to Anjal.

So Anjal checks first. If your domain's MX records point at Google Workspace, Anjal stops and asks what you want to do:

  • Keep Google and add Anjal mailboxes alongside it. This is the shared domain option, and the one this guide covers.
  • Use a separate subdomain, such as agents.yourcompany.com, just for Anjal. Nothing about your existing mail changes.
  • Move all mail for the domain to Anjal. Only choose this if you are leaving Google.

With a shared domain, Google stays your main mail server. Your MX record does not change. When mail arrives for an address Google does not know about, Google passes it on to Anjal. When your agent sends, it signs with your domain through Anjal's sending records.

What you need

  • Admin access to your Google Workspace (the Admin console).
  • Access to your domain's DNS settings.
  • An Anjal account.

Step 1: Add the domain and choose to share it

In the Anjal dashboard, open Domains and add your domain. When Anjal sees that it already receives mail at Google, it asks what to do. Choose Keep Google Workspace and add Anjal mailboxes alongside it.

If you use the API or an MCP client instead, add the domain with sharedWith:

curl -X POST https://anjal.app/v1/domains \
  -H "X-API-Key: $ANJAL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain": "yourcompany.com", "sharedWith": "google"}'

The response lists the DNS records to add and the Google routing steps for your domain.

Step 2: Add the DNS records

Add the records Anjal shows you at your DNS provider. For a shared domain they are:

  • Three DKIM records (CNAME). These let Anjal sign mail as your domain.
  • One SPF record (TXT). Anjal merges its sending service into your existing SPF record instead of giving you a second one. A domain must have only one SPF record, because two make SPF fail. Replace your current record with the one Anjal shows. It keeps everything already in it, including Google.
  • A DMARC record, only if your domain has none. If you already have one, Anjal leaves it alone.

There is no MX record to add. Leave your Google MX records exactly as they are.

Two records are optional but improve placement. They sit on a bounce. subdomain and make the envelope sender your own domain, so SPF lines up with your From address. Sending works without them.

Step 3: Tell Google to pass unknown addresses to Anjal

This is the step that makes the Anjal inboxes receive mail. In the Google Admin console:

  1. Go to Apps > Google Workspace > Gmail > Hosts and add a route named "Anjal". Use a single host, mail.anjal.app, on port 25. Turn on Require secure transport (TLS) and Require CA signed certificate, then save.
  2. Go to Apps > Google Workspace > Gmail > Default routing and click Add another rule.
  3. Match envelope recipients with a pattern match on your domain, for example .*@yourcompany\.com$.
  4. Set the route to the "Anjal" route you just made. Under options, choose Perform this action only on non-recognized addresses, then save.

The last option is the important one. It means Google handles every address it already has, and only passes on addresses it does not recognize. Your team's mail is unchanged.

Google's menus change over time. Anjal shows the current steps for your domain in the dashboard and in the API response, so use those if what you see here differs.

Step 4: Verify and create an inbox

Back in Anjal, click Verify on the domain. Once the DNS records resolve, the domain shows as verified. Then create an inbox on it, for example agent@yourcompany.com.

Send a test message from a personal address to the new inbox. It should arrive in Anjal and not in Gmail. Then send one from the agent inbox to yourself and check that it arrives and passes authentication.

Things to know

  • An address that already exists in Google stays in Google. Google only passes on addresses it does not know. If sales@yourcompany.com is already a Gmail user or group, Anjal will not receive it. Pick an address Google does not have, or remove it from Google first.
  • A Google catch-all can swallow the mail. If you have set up a catch-all in Gmail so every unknown address lands in one inbox, Google will treat the Anjal address as known and keep the mail. Turn the catch-all off or exclude the Anjal address.
  • Keep one SPF record. If you add Anjal to SPF by hand and also use the record Anjal shows, you can end up with two. Check that there is exactly one.
  • Do not change your MX records. Moving MX to Anjal would stop your team's mail from reaching Gmail.

Microsoft 365 and other providers

The same idea works for Microsoft 365 and other mail hosts. You keep your provider as the main mail server and set it to pass mail for unknown addresses to Anjal. For Microsoft 365, the Exchange admin center needs the domain set to internal relay and a connector to Anjal. Add the domain with sharedWith: "microsoft" (or "other") and Anjal shows the steps for that provider.

Prefer to keep it simple?

If you would rather not touch routing, use a subdomain like agents.yourcompany.com. It needs only the DNS records and no changes in Google. Your agent's address is a little longer, and everything else stays the same.

Frequently asked questions

Can my team keep using Gmail?

Yes. In a shared domain, Google stays your main mail server and your MX records do not change.

Will my existing mail be affected?

No. Google keeps handling every address it already has. Only addresses Google does not recognize are passed on to Anjal.

Does the agent send from my domain?

Yes. Mail is signed with your domain's DKIM records and passes SPF and DMARC, so it looks like it comes from agent@yourcompany.com.

Do I need to be a Google Workspace admin?

Yes, for the routing step. You need access to the Admin console to add the host and the routing rule. You also need access to your DNS settings.

What if I change my mind?

Remove the routing rule in Google and delete the domain in Anjal. Your Gmail setup is the same as before you started, because your MX records never changed.

← All posts