Skip to main content
Setting up a custom sending domain improves deliverability and allows you to send from your own email addresses. This guide walks you through the complete DNS configuration process.

Why Use a Custom Domain?

  • Better deliverability: Email providers trust authenticated domains
  • Brand consistency: Send from [email protected] instead of a shared domain
  • Full control: Manage your sender reputation independently

Prerequisites

  • Access to your domain’s DNS settings (usually through your registrar or hosting provider)
  • An Ark account with API access

Step 1: Add Your Domain

from ark import Ark

client = Ark()

domain = client.domains.create(name="mail.yourdomain.com")

print(f"Domain ID: {domain.data.id}")
print("DNS Records to configure:")
for record in domain.data.dns_records:
    print(f"  {record.type} {record.name} -> {record.value}")
The response includes the DNS records you need to add:
{
  "dnsRecords": [
    {
      "type": "TXT",
      "name": "ark1._domainkey.mail.yourdomain.com",
      "value": "v=DKIM1; k=rsa; p=MIGfMA0G...",
      "purpose": "DKIM"
    },
    {
      "type": "TXT",
      "name": "mail.yourdomain.com",
      "value": "v=spf1 include:spf.arkhq.io ~all",
      "purpose": "SPF"
    },
    {
      "type": "CNAME",
      "name": "ark-verify.mail.yourdomain.com",
      "value": "verify.arkhq.io",
      "purpose": "Verification"
    }
  ]
}

Step 2: Configure DNS Records

Add the following records to your DNS provider:

DKIM Record

DKIM cryptographically signs your emails to prove they came from your domain.
FieldValue
TypeTXT
Nameark1._domainkey.mail.yourdomain.com
Valuev=DKIM1; k=rsa; p=MIGfMA0G... (from API response)
TTL3600 (or default)

SPF Record

SPF tells receiving servers which IPs are authorized to send email for your domain.
FieldValue
TypeTXT
Namemail.yourdomain.com
Valuev=spf1 include:spf.arkhq.io ~all
TTL3600 (or default)
If you already have an SPF record, add include:spf.arkhq.io to your existing record instead of creating a new one. Only one SPF record is allowed per domain.

Verification CNAME

This allows Ark to verify domain ownership.
FieldValue
TypeCNAME
Nameark-verify.mail.yourdomain.com
Valueverify.arkhq.io
TTL3600 (or default)

Step 3: Verify Your Domain

After adding DNS records, wait for propagation (can take up to 48 hours, but usually faster) and verify:
result = client.domains.verify("dom_abc123")

if result.data.verified:
    print("Domain verified successfully!")
else:
    print("DNS records not found. Please check your configuration.")
Success! Once verified, you can send emails from any address at your domain (e.g., [email protected], [email protected]).

Optional: DMARC Configuration

DMARC adds another layer of authentication and tells receiving servers how to handle emails that fail authentication. Add this TXT record:
FieldValue
TypeTXT
Name_dmarc.mail.yourdomain.com
Valuev=DMARC1; p=none; rua=mailto:[email protected]
Start with p=none to monitor, then move to p=quarantine or p=reject once you’re confident in your configuration.

Troubleshooting

Verification Failed

  1. Check DNS propagation: Use dnschecker.org to verify records are visible globally
  2. Check record values: Ensure you copied the exact values from the API response
  3. Wait and retry: DNS can take up to 48 hours to propagate fully

SPF Issues

If you have multiple services sending email:
v=spf1 include:spf.arkhq.io include:_spf.google.com include:sendgrid.net ~all
SPF has a 10 DNS lookup limit. If you exceed this, some emails may fail authentication.

Next Steps