One-Click Domain Setup with Domain Connect
2026-03-05
Setting up a custom sending domain has always been the biggest friction point in email onboarding. You tell your user to add three DNS records — DKIM, SPF, DMARC — and they stare at a table of cryptographic values they don't understand, wondering which field is "Name" and which is "Value" in their DNS provider's UI.
Today we're shipping one-click domain setup powered by Domain Connect, an open standard supported by Cloudflare, GoDaddy, Namecheap, and dozens of other DNS providers. If your user's domain is hosted on a supported provider, they can configure all three DNS records with a single click — no copy-pasting required.
More importantly, your AI agent can now generate and send this link directly.
What changed
We added domain management endpoints to the agent API. Your agent can now:
- Add a domain — register it with Molted and get the required DNS records
- Check Domain Connect support — detect if the user's DNS provider supports one-click setup
- Get a setup link — a signed URL that takes the user straight to their DNS provider's approval page
- Verify the domain — confirm DNS records are in place after the user approves
The entire flow can happen inside a conversation between your agent and your user.
How it works
When your agent calls the Domain Connect endpoint, we look up the user's DNS provider by querying a special _domainconnect TXT record on their domain. If their provider supports the protocol, we return a signed redirect URL. When the user clicks that link, they're taken to their DNS provider (e.g. Cloudflare), shown exactly which records will be added, and click "Approve." All three records are applied instantly. The user is redirected back to Molted, and we automatically trigger verification.
No more "go to your DNS settings, find the TXT record section, paste this value..."
Teaching your agent to set up domains
Here's the flow your agent should follow. These examples use the Molted agent API with Bearer token auth.
Step 1: Add the domain
curl -X POST https://api.molted.email/v1/agent/domains \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"tenantId": "tenant_abc", "domain": "notifications.example.com"}'
The response includes the domain ID and the DNS records that need to be configured:
{
"id": "d_01abc...",
"domain": "notifications.example.com",
"status": "pending",
"dns_records": [
{"type": "TXT", "name": "notifications.example.com", "value": "v=spf1 include:send.resend.com ~all", "status": "pending"},
{"type": "CNAME", "name": "resend._domainkey.notifications.example.com", "value": "...", "status": "pending"},
{"type": "TXT", "name": "_dmarc.notifications.example.com", "value": "v=DMARC1; p=none", "status": "pending"}
]
}
Step 2: Check for one-click setup
curl 'https://api.molted.email/v1/agent/domains/d_01abc.../domain-connect?tenantId=tenant_abc' \
-H 'Authorization: Bearer YOUR_API_KEY'
If the user's DNS provider supports Domain Connect:
{
"supported": true,
"redirectUrl": "https://dash.cloudflare.com/cdn-cgi/access/domain-connect/v2/domainTemplates/providers/molted.email/services/moltedmail/apply?domain=example.com&host=notifications&..."
}
If not:
{
"supported": false,
"reason": "DNS provider does not support Domain Connect"
}
Step 3: Send the link or fall back to manual
If Domain Connect is supported, your agent can send the redirect URL to the user:
"I've registered notifications.example.com as your sending domain. Your DNS is managed by Cloudflare, so you can set everything up with one click:
Click the link, approve the DNS changes, and you're done."
If it's not supported, your agent should share the DNS records from step 1 and guide the user through manual setup.
Step 4: Verify
After the user completes the Domain Connect flow (or manually adds records), verify the domain:
curl -X POST https://api.molted.email/v1/agent/domains/d_01abc.../verify \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"tenantId": "tenant_abc"}'
{
"id": "d_01abc...",
"domain": "notifications.example.com",
"status": "verified",
"dns_records": [
{"type": "TXT", "name": "...", "value": "...", "status": "verified"},
{"type": "CNAME", "name": "...", "value": "...", "status": "verified"},
{"type": "TXT", "name": "...", "value": "...", "status": "verified"}
]
}
Once the status is verified, the domain is ready to send from.
Example: agent tool definition
If you're using function calling, here's how you might define the domain setup tools for your agent:
[
{
"name": "add_sending_domain",
"description": "Register a custom sending domain with Molted Email. Returns DNS records that need to be configured.",
"parameters": {
"type": "object",
"properties": {
"tenant_id": {
"type": "string",
"description": "The tenant ID for this account"
},
"domain": {
"type": "string",
"description": "The domain to register, e.g. mail.example.com"
}
},
"required": ["tenant_id", "domain"]
}
},
{
"name": "check_domain_connect",
"description": "Check if a domain's DNS provider supports one-click setup via Domain Connect. If supported, returns a URL the user can click to automatically configure all DNS records.",
"parameters": {
"type": "object",
"properties": {
"tenant_id": {
"type": "string",
"description": "The tenant ID for this account"
},
"domain_id": {
"type": "string",
"description": "The domain ID returned by add_sending_domain"
}
},
"required": ["tenant_id", "domain_id"]
}
},
{
"name": "verify_sending_domain",
"description": "Trigger DNS verification for a domain after the user has configured DNS records (either via Domain Connect or manually).",
"parameters": {
"type": "object",
"properties": {
"tenant_id": {
"type": "string",
"description": "The tenant ID for this account"
},
"domain_id": {
"type": "string",
"description": "The domain ID to verify"
}
},
"required": ["tenant_id", "domain_id"]
}
}
]
With these tools, your agent can handle the entire domain setup conversation autonomously — detecting the best path (one-click vs. manual), generating the right link, and confirming verification.
Portal users get it too
If your users prefer the portal UI, the same one-click flow is available in Dashboard > Domains. After adding a domain, if we detect Domain Connect support, a blue "Set up DNS automatically" button appears alongside the manual DNS records table. After the user approves at their DNS provider, verification triggers automatically on redirect.
Supported DNS providers
Domain Connect is supported by a growing list of providers including Cloudflare, GoDaddy, 1&1 IONOS, Namecheap, and others — covering a significant share of registered domains. For domains hosted on providers that don't support the protocol, the manual DNS record flow remains the default.
Custom domains are a critical part of email deliverability — they let you build sender reputation on your own domain rather than sharing it. Anything that reduces the friction of getting them set up means your users start sending authenticated email faster.
Check out the domain setup docs for the full reference, or get started if you haven't already.