Skip to main content

Overview

Use your own domain for sending and receiving emails to maintain brand identity and improve deliverability. Custom domains require DNS verification through MX, DKIM, SPF, and DMARC records.

Why Use Custom Domains?

Brand Identity

Send emails from your own domain (e.g., [email protected]) instead of @sendook.com

Better Deliverability

Properly configured custom domains improve email deliverability and reduce spam scores

Professional Appearance

Emails from your domain appear more trustworthy to recipients

Receive Emails

Route incoming emails to your domain through Sendook

Adding a Custom Domain

1

Create the domain

Add your domain to Sendook:
import Sendook from "@sendook/node";

const client = new Sendook("your_api_key");

const domain = await client.domain.create({
  name: "yourdomain.com"
});

console.log(domain);
// {
//   id: "domain_123",
//   organizationId: "org_456",
//   name: "yourdomain.com",
//   verified: false,
//   records: [],
//   createdAt: "2024-01-01T00:00:00.000Z"
// }
2

Get DNS records

Retrieve the DNS records you need to configure:
const dnsRecords = await client.domain.dns({
  domainId: "yourdomain.com"
});

console.log(dnsRecords);
3

Configure DNS

Add the DNS records to your domain’s DNS settings (see detailed instructions below).
4

Verify the domain

After adding DNS records, verify your domain:
const verifiedDomain = await client.domain.verify({
  domainId: "yourdomain.com"
});

console.log(verifiedDomain.verified); // true
DNS changes can take up to 48 hours to propagate, but typically complete within a few hours.

Required DNS Records

You’ll need to configure four types of DNS records:

1. MX Record (Mail Exchange)

Routes incoming emails to AWS SES:
Type: MX
Name: @ (or subdomain)
Priority: 10
Value: inbound-smtp.us-east-2.amazonaws.com
MX (Mail Exchange) records tell other email servers where to send emails for your domain. This record directs incoming emails to AWS SES, which Sendook uses to receive and process your emails.

2. DKIM Records (DomainKeys Identified Mail)

Verifies email authenticity (3 CNAME records):
Type: CNAME
Name: {token1}._domainkey.yourdomain.com
Value: {token1}.dkim.amazonses.com

Type: CNAME
Name: {token2}._domainkey.yourdomain.com
Value: {token2}.dkim.amazonses.com

Type: CNAME
Name: {token3}._domainkey.yourdomain.com
Value: {token3}.dkim.amazonses.com
The {token} values are unique to your domain and returned by the DNS endpoint. They look like: abcd1234efgh5678ijkl
DKIM adds a digital signature to your emails, allowing recipients to verify that emails claiming to be from your domain were actually sent by you and haven’t been tampered with in transit.

3. SPF Record (Sender Policy Framework)

Authorizes AWS SES to send emails on your behalf:
Type: TXT
Name: @ (or subdomain)
Value: v=spf1 include:amazonses.com ~all
SPF specifies which mail servers are allowed to send emails on behalf of your domain. This helps prevent email spoofing and improves deliverability.
If you already have an SPF record, you’ll need to add include:amazonses.com to your existing record rather than creating a new one. Multiple SPF records can cause delivery issues.
Defines how to handle emails that fail authentication:
Type: TXT
Name: _dmarc (or _dmarc.subdomain)
Value: v=DMARC1; p=reject;
DMARC builds on SPF and DKIM to provide additional protection against email spoofing. It tells receiving mail servers what to do with emails that fail authentication checks (reject, quarantine, or monitor).
Start with p=none to monitor without affecting delivery, then move to p=quarantine or p=reject once you’re confident your setup is correct.

DNS Configuration Examples

Cloudflare

  1. Go to your domain in Cloudflare
  2. Click DNS in the sidebar
  3. Add each record with the values provided
  4. Make sure Proxy status is set to DNS only (gray cloud)

GoDaddy

  1. Log in to your GoDaddy account
  2. Go to My ProductsDNS
  3. Click Add for each record type
  4. Enter the name, type, and value for each record

Namecheap

  1. Log in to Namecheap
  2. Go to Domain List and click Manage
  3. Go to Advanced DNS
  4. Click Add New Record for each DNS entry

Route 53 (AWS)

  1. Go to the Route 53 console
  2. Select your hosted zone
  3. Click Create Record
  4. Add each record type with the provided values

Verifying Your Domain

After adding DNS records:
  1. Wait 5-10 minutes for DNS propagation
  2. Call the verify endpoint
  3. Check the verification status
const domain = await client.domain.verify({
  domainId: "yourdomain.com"
});

if (domain.verified) {
  console.log("Domain verified! You can now use it.");
} else {
  console.log("Verification pending. Check DNS records.");
  console.log(domain.records); // Shows which records are missing/incorrect
}
Your domain must be verified before you can create inboxes with it. Attempting to create an inbox with an unverified domain will return a 404 error.

Managing Domains

List All Domains

const domains = await client.domain.list();

console.log(domains);
// [
//   {
//     id: "domain_123",
//     name: "yourdomain.com",
//     verified: true,
//     createdAt: "2024-01-01T00:00:00.000Z"
//   }
// ]

Get Domain Details

const domain = await client.domain.get({
  domainId: "yourdomain.com"
});

console.log(domain);

Delete a Domain

await client.domain.delete({
  domainId: "yourdomain.com"
});
Deleting a domain will prevent you from using it for new inboxes, but existing inboxes using that domain will continue to work until they’re deleted.

Using Subdomains

You can also use subdomains (e.g., mail.yourdomain.com):
await client.domain.create({
  name: "mail.yourdomain.com"
});
Subdomains are useful for:
  • Separating transactional and marketing emails
  • Testing before switching your main domain
  • Using different configurations for different services

Troubleshooting

Common causes:
  • DNS records haven’t propagated yet (wait 10-30 minutes)
  • Records are configured incorrectly (double-check values)
  • Proxy is enabled on Cloudflare (must be DNS only)
  • Multiple SPF records exist (combine into one)
Solution: Use a DNS checker tool like MXToolbox or DNS Checker to verify your records are correct.
Check:
  • Domain is verified
  • MX record is configured correctly
  • MX record priority is set to 10
  • DNS changes have propagated globally
Test: Send an email to your custom domain inbox from an external email client.
Improve deliverability:
  • Ensure all DNS records are configured (especially SPF, DKIM, DMARC)
  • Warm up your domain by gradually increasing send volume
  • Avoid spam trigger words in subject lines
  • Include unsubscribe links in marketing emails
  • Monitor your sender reputation
If you already have an SPF record for other email services:Incorrect:
v=spf1 include:outlook.com ~all
v=spf1 include:amazonses.com ~all
Correct:
v=spf1 include:outlook.com include:amazonses.com ~all
Combine all include: directives into a single SPF record.

Best Practices

Start with a subdomain - Test with a subdomain (e.g., mail.yourdomain.com) before configuring your main domain.
Monitor DNS records - Regularly check that your DNS records remain correctly configured, especially after making other DNS changes.
Use DMARC reporting - Configure DMARC with rua and ruf tags to receive reports about authentication failures.
Warm up your domain - For new domains, start with low send volumes and gradually increase to build sender reputation.

Next Steps

Create Inboxes

Create inboxes using your verified custom domain

Send Emails

Start sending emails from your custom domain

Receive Emails

Set up webhooks to receive emails at your domain

API Reference

View complete domain API documentation

Build docs developers (and LLMs) love