On this page
If you're a hosting company, SaaS platform, or managed email provider running transactional email on behalf of dozens or hundreds of customer domains, migrating from SendGrid to AhaSend requires a bit more planning than a single-domain switch. The good news: with the right DNS architecture in place, you can migrate each customer domain with a 30-minute maintenance window and zero permanent DNS changes on the customer's side after the initial setup.
This guide walks through the full process, from preparation to live cutover.
Updated November 2026: AhaSend can now reuse the DKIM selectors your customers already have, including SendGrid's s1/s2 and os1/os2 pairs, and you can give each customer its own sub-account.
This guide covers the DNS side. For API fields, SMTP settings, webhooks and suppressions, see the SendGrid migration guide in our docs.
The architecture: why a DNS relay layer matters
When you manage email for many customers, the biggest migration risk is DNS coordination. Asking every customer to update their DNS records twice, once to set up AhaSend and potentially again if you change providers or infrastructure later, creates operational noise and support overhead.
The approach described here solves that by introducing a DNS relay layer at your platform domain. Your customers point their DNS records once to your platform domain (for example customer.com → dkim1.customer.com.yourplatformdomain.com). From that point on, your platform domain controls where those records resolve. You can cut over from SendGrid to AhaSend by updating your own DNS records, with no further action required from your customers.
This is a one-time setup cost that permanently eliminates customer DNS coordination for all future migrations or infrastructure changes.
What to gather before you start
Before touching any DNS or AhaSend configuration, collect the following for each customer domain from your SendGrid dashboard:
DKIM configuration: For each domain, note the DKIM selector(s) in use and the full DKIM subdomain. SendGrid typically uses s1/s2 or os1/os2 as selectors, with corresponding subdomains like s1._domainkey or os1._domainkey. These vary per customer, so check each domain individually in the SendGrid dashboard. Write down the first selector of each pair: that is the one you give AhaSend in Step 3.
Return-Path subdomain: Note the Return-Path subdomain currently in use. This often looks like em3560.customer.com. AhaSend lets you set a custom Return-Path subdomain, which means you can reuse the customer's existing record rather than creating a new one. This avoids dangling DNS records and keeps the customer's DNS clean.
Tracking domain: Note any custom tracking domain in use, for example url7936.customer.com. If a customer doesn't have a custom tracking domain configured in SendGrid, you can use AhaSend's default tracking setup.
Step 1: Set up the DNS relay layer at your platform domain
For each customer domain, create CNAME records at your platform domain (yourplatformdomain.com) that initially point to the current SendGrid destinations. These are the intermediate records your customers will point to. Later, you update them to point to AhaSend.
Using customer.com as an example customer domain:
| Record at yourplatformdomain.com | Type | Initially points to | After migration points to |
|---|---|---|---|
| dkim1.customer.com.yourplatformdomain.com | CNAME | s1.domainkey.<customerid>.wl035.sendgrid.net | uniqueidentifier.setup.ahasend.com |
| dkim2.customer.com.yourplatformdomain.com | CNAME | s2.domainkey.<customerid>.wl035.sendgrid.net | uniqueidentifier.setup.ahasend.com |
| track.customer.com.yourplatformdomain.com | CNAME | sendgrid.net | track.ahasend.com |
| prsp.customer.com.yourplatformdomain.com | CNAME | em<customerid>.wl035.sendgrid.net. | rp.ahasend.com |
Step 2: Ask each customer to update their DNS records (once, ever)
Each customer needs to add or update their DNS records to point at your platform domain instead of directly at SendGrid. This is the only DNS change customers will ever need to make.
Using customer.com as the example:
| Record | Type | Update to |
|---|---|---|
| s1._domainkey.customer.com | CNAME | dkim1.customer.com.yourplatformdomain.com |
| s2._domainkey.customer.com | CNAME | dkim2.customer.com.yourplatformdomain.com |
| url<customerid>.customer.com | CNAME | track.customer.com.yourplatformdomain.com |
| em<customerid>.customer.com | CNAME | prsp.customer.com.yourplatformdomain.com |
Note: if a customer has no tracking record and needs tracking, use AhaSend's default: t.customer.com points to track.customer.com.yourplatformdomain.com, which points to track.ahasend.com.
Step 3: Configure AhaSend to match the customer's existing SendGrid settings
This is where AhaSend's support for custom subdomains makes the migration smooth. Rather than assigning new default subdomains that would create new DNS records, you configure AhaSend to match exactly what's already in place at SendGrid.
For each customer domain in the AhaSend dashboard, under Domain Settings or via the Management API:
DKIM: Set the domain's DKIM selector to the first selector the customer already uses, for example s1. AhaSend domains with managed DNS use two DKIM selectors, so we can rotate keys without another DNS change. The second selector follows from the first: a selector that ends in 1 gets a partner that ends in 2. So s1 gives s2 and os1 gives os2, exactly the pairs SendGrid uses, and the relay records from Step 1 work unchanged after the cutover.
You can create the domain while the customer's DKIM records still resolve to SendGrid: AhaSend no longer refuses a selector whose DNS records already exist. DKIM passes once the relay records point to the records AhaSend gives you. The selector locks when the domain's DKIM is verified, so set it before the cutover. A custom DKIM selector is part of DNS whitelabel, which is included on the Max plan.
Return-Path: Set the Return-Path subdomain to match the customer's existing record (for example em1234). No new DNS record is needed. The existing record the customer already has in place continues to work: it just resolves through your platform relay to AhaSend after the cutover.
Tracking: Set the tracking subdomain to match the customer's existing SendGrid tracking domain. For customers without a custom tracking domain at SendGrid, use AhaSend's default.
The key principle here: because AhaSend supports full customisation of subdomains, you can mirror the existing SendGrid configuration exactly. No new records, no customer communication required, no dangling DNS entries.
Through the Management API, one request sets all three when you create the domain:
curl --request POST \
--url https://api.ahasend.com/v2/accounts/{account_id}/domains \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"domain": "customer.com",
"dkim_selector": "s1",
"return_path_subdomain": "em3560",
"tracking_subdomain": "url7936"
}'One sub-account per customer: if your customers should be fully separate from each other, create a sub-account for each customer first and add the domain there. A sub-account has its own domains, API keys, webhooks and members, and its volume is billed through your account. You can create sub-accounts and their first API key through the API as well.
Step 4: Lower your platform domain TTL
Before cutting over any customer, lower the TTL on your platform domain (yourplatformdomain.com) DNS records to 300 seconds. This ensures that when you update the relay records to point at AhaSend, the change propagates quickly.
Do this well in advance, at least a few hours before the planned maintenance window, to allow existing cached records to expire.
Do not proceed to Step 5 before the DNS changes from Steps 1 and 2 are in place and propagated.
Step 5: Cut over each customer domain
When a customer is ready to migrate (or when you're ready to migrate them):
- Confirm the platform domain TTL is at 300 seconds.
- Schedule a 30-minute maintenance window. During this window:
- Update the relay records at your platform domain to point to AhaSend instead of SendGrid. For
customer.com, this means updating:dkim1.customer.com.yourplatformdomain.com→uniqueidentifier.setup.ahasend.comdkim2.customer.com.yourplatformdomain.com→uniqueidentifier.setup.ahasend.comtrack.customer.com.yourplatformdomain.com→track.ahasend.comprsp.customer.com.yourplatformdomain.com→rp.ahasend.com - Trigger domain verification in AhaSend, with Check DNS in the dashboard or the Check DNS endpoint, and wait for confirmation.
- Send a test email and verify delivery.
- End the maintenance window.
The customer's DNS records have not changed. Only your platform domain relay records changed, which is entirely within your control.
From here on, AhaSend rotates the DKIM keys of the domain by itself. Both selectors already resolve through your relay, so a rotation needs no DNS change from you or your customer.
Why this approach works at scale
For a hosting company or SaaS platform managing dozens or hundreds of customer domains, this architecture has several practical advantages.
Customer coordination is a one-time cost. After the initial DNS update, future migrations, whether to a different AhaSend configuration or to a different provider entirely, require no customer involvement.
Reusing existing DNS records avoids the noise of dangling or orphaned records in customer DNS zones. When you reuse the Return-Path subdomain and DKIM subdomains rather than creating new ones, the customer's DNS zone stays clean and easy to audit.
Maintenance windows are short and predictable. Because all the infrastructure work happens in advance, the actual cutover is a DNS update and a verification check.
You can script the AhaSend configuration step with the Management API, the CLI or the Go and TypeScript SDKs, which makes it practical to prepare dozens of domains in parallel before any maintenance window begins.
Start for free on AhaSend
AhaSend is a European email service built for platform partners and developers. The Management API and GDPR-compliant infrastructure come with every plan. Sub-accounts are included on Pro and Max, and custom DKIM selectors are part of DNS whitelabel on Max.