Using Custom Domains

Strengthen your agent's identity and improve deliverability with your own domain.

Why Use a Custom Domain?

When you’re deploying AI agents that send email at scale, deliverability and trust are paramount. While the default @agentmail.to domain is great for getting started, using your own custom domains is essential for production applications. It gives you control over your sending reputation and enables advanced strategies for high-volume outreach.

Improved Deliverability

Each domain builds its own sending reputation. By using your own domain, you control this reputation, which is the single most important factor in reaching the inbox.

Scale with Multiple Domains

For high-volume sending, register multiple domains (e.g., mercor.com, usemercor.com, mercorapp.com). Spreading email volume across them is a key strategy to maximize deliverability.

Setting Up Your Custom Domain

Configuring your domain is a three-step process: add the domain via API, copy the provided records into your DNS provider, and wait for verification.

1

1. Create Domain & Get DNS Records

Choose your preferred method to create a domain and get the required DNS records. AgentMail will register your domain and immediately return the full set of DNS records required for verification.

Navigate to the AgentMail Console and follow these steps:

  1. Go to Domains Section: Click on “Domains” in the left sidebar
  2. Add New Domain: Click “Add Domain” or “Create Domain” button
  3. Enter Domain Name: Type your domain name (e.g., your-domain.com)
  4. Create Domain: Click “Create” to register the domain
2

2. Add Records to Your DNS Provider

The process for adding records varies slightly between providers. The examples below assume you are configuring records in the apex domain.com hosted zone. If you are using a subdomain make sure it is in the apex domain hosted zone.

Option A: Upload BIND Zone File (Easiest)

A BIND zone file is a text file that contains DNS resource records in a standardized format. This approach allows you to bulk upload our records to your DNS provider without you needing to go down one by one.

How to use the BIND zone file:

Step 1: Download the BIND zone file

After creating your domain in the AgentMail Console, click the “Download BIND Zone File” button to get the complete zone file.

Download BIND Zone File from Console
Downloading BIND zone file from AgentMail Console

Step 2: Import to Route 53

  1. Go to your Route 53 hosted zone for your domain
  2. Click “Import zone file” in the top right corner
AWS Route 53 BIND Import
Importing BIND zone file in AWS Route 53
  1. Paste the CONTENTS of downloaded BIND zone file
AWS Route 53 BIND Import
Open the file with text editor and paste the contents. It should look similar to what we have in this image.
  1. Review the records and click “Import”
BIND Zone File Format

Check that all records (CNAME, TXT, MX) have been correctly imported in the console(the console will show in real time if we can find the records, typically within seconds).

Option B: Add Individual Records

Below are detailed instructions for AWS Route53, CloudFlare, and Namecheap. The instructions vary depending on whether you’re using the AgentMail Console or the API directly.

If you created your domain through the AgentMail Console, the DNS records are displayed in a simplified format that’s ready for copy-paste into your DNS provider.

In your hosted zone, click “Create record”.

  • CNAME (DKIM):

    • Record name: Copy the Name value directly from the console (e.g., abc123._domainkey).
    • Value: Copy the Value from the console (e.g., abc123.dkim.amazonses.com).
  • TXT (DMARC/SPF):

    • Record name: Copy the Name value directly from the console (e.g., _dmarc or mail).
    • Value: Copy the Value from the console, ensuring it is enclosed in quotes.
  • MX:

    • Record name: Enter the value exactly as we return it, whether its @ or the subdomain.
    • Value: Copy the Value from the console (e.g., inbound-smtp.us-east-1.amazonaws.com).
    • Priority: Use the priority shown in the console (typically 10).
Console Advantage

The console automatically formats DNS record names to be relative hostnames (without the full domain), making them ready for direct copy-paste into your DNS provider. No manual parsing required!

3

3. Verify Your Domain

Once you’ve added the records, AgentMail automatically begins to check them. This can take anywhere from a few minutes to 48 hours for your DNS changes to propagate across the internet.

Check your domain verification status in the AgentMail Console:

  1. Navigate to Domains: Go to the “Domains” section in the left sidebar
  2. View Domain Status: Find your domain in the list and check its status
  3. Monitor Progress: The status will update automatically as verification progresses
  4. View Details: Click on your domain to see detailed information about which records are verified

The status indicators will show you exactly where you are in the process:

  • Not Started: You need to click the Verify Domain button to kick start the process
  • Pending: You still need to add or fix your DNS records
  • Invalid: Some of your records are misconfigured. Please verify you inputted them correctly.
  • Failed: Your records are correct, but our servers need a bump. Please click the verify domain button in the console.
  • Verifying: DNS records are correct, and we’re authorizing the domain
  • Verified: Domain is fully verified and ready for sending

Here are instructions for some common DNS providers. This list is not exhaustive, so please consult your provider’s documentation if you don’t see it here.

Ready to Go!

Once your domain status is ready, you can start creating Inboxes with your custom domain and building your agents!

Troubleshooting Common DNS Issues

DNS can be tricky. Here are some common issues and how to resolve them.

DNS propagation can take up to 48 hours, though it’s often much faster. If it’s been a while, click the verify domain button in the console which will trigger a reverification manually(DNS propagation can get stuck at times).

A domain must have only one SPF record. If you’re using other services that send email on your behalf (like a CRM), you need to merge their SPF policies with AgentMail’s into a single record.

An SPF record is a single line of text. It starts with v=spf1 and ends with a mechanism like ~all or -all. All your permitted senders go in the middle.

How to Merge:

  1. Find your existing SPF record. It will look something like this: v=spf1 include:_spf.other-domain.com ~all
  2. Find AgentMail’s SPF include. This is include:spf.agentmail.to.
  3. Combine them. Copy the include from AgentMail and place it into your existing record, right before the ~all or -all part.
Example: Merging SPF records
# Before
v=spf1 include:_spf.other-domain.com ~all
# After
v=spf1 include:_spf.other-domain.com include:spf.agentmail.to ~all

Just keep adding include: mechanisms for each service you use. Remember to only have one v=spf1 at the beginning and one ~all or -all at the end.

Best Practices for Domain Management

Check out our guide on Email Deliverability for tips on warming up your new domain and maintaining a healthy sender reputation.