Why Automation Is the Only Sustainable Way to Deploy Custom Domain Email

Imagine setting up email for 50 new client domains—each requiring MX, SPF, DKIM, and DMARC records. Manually doing this? You’re not scaling. You’re just delaying.

Every mistyped DNS record breaks deliverability. Every forgotten step creates a security gap. For developers managing fleets of domains, manual setup isn’t just tedious—it’s unsustainable.

That’s why automation via API is the only way to deploy custom domain email at scale. It turns configuration from a high-risk chore into a repeatable, auditable process—no more guesswork, no more downtime.

Key takeaways

  • Manual DNS configuration for custom domains is error-prone and unscalable beyond a handful of domains.
  • API automation eliminates human error by generating and validating MX, SPF, DKIM, and DMARC records consistently across all domains.
  • Teams can self-serve domain setup with real-time validation, drastically reducing onboarding time and admin overhead.

How Unifiedesk’s API Simplifies Domain Email Automation

You can automate custom domain email setup with Unifiedesk’s API by programmatically registering your domain and instantly receiving the exact MX, SPF, DKIM, and DMARC DNS records needed to authenticate your email. The API handles the entire process—no manual config, no guesswork—and lets you push records to any DNS provider or registrar with full control. This is how you deploy trusted, secure email at scale without breaking a sweat.

Automated DNS Record Generation for Every Domain

When you add a custom domain via the Unifiedesk API, it doesn’t just store your domain—it generates the full suite of required DNS records in real time. Every request triggers automatic creation of MX, SPF, DKIM, and DMARC entries, each tailored precisely for your domain and aligned with industry standards like RFC 5321 (SMTP) and RFC 6376 (DKIM).

Think of it like a reverse setup wizard: instead of digging through manuals or copying random snippets from forums, you get a clean, ready-to-place set of records returned directly in the API response. You don’t need to know the magic numbers—just send the domain and receive the exact values to paste into your DNS provider’s dashboard or API.

Programmatic Control Across Your Infrastructure

Let’s say you run a SaaS platform and need to onboard 500 users with company-branded email. With Unifiedesk’s API, you can loop through domains, verify ownership, and push DNS records in seconds. No more manual steps, no chance of typo-based email failure.

The records are generated dynamically based on your configuration—whether you’re using a free @unifiedesk.com address or a self-hosted deployment. You get the flexibility to automate everything from onboarding to compliance checks.

For developers building internal tools, email provisioning flows, or integration layers, the API makes it possible to manage domains and email infrastructure exactly as your app needs. It’s not just a feature—it’s a production-grade building block.

Once set up, your users can use all Unifiedesk services: send secure mail, schedule events, share files via encrypted Drive, collaborate in real time with Docs, or hold meetings with Meet. Everything works under a single, trusted domain.

And if you prefer full ownership, you can run Unifiedesk self-hosted—with the same API, same DNS automation, and the full benefit of per-account encryption at rest.

Security is baked in: all data in transit uses TLS, and all data at rest—on hosted or self-hosted platforms—is encrypted with AES-256-GCM. When you automate this way, you’re not just saving time—you’re building a system that’s safe by design.

Want to try it? Head to our setup guide and start deploying domains with confidence.

How the API Works: Step-by-Step Domain Registration and DNS Setup

You send your domain to Unifiedesk’s API, it validates it, and returns all necessary DNS records—MX, SPF, DKIM, DMARC—so you can configure your DNS provider in minutes. Once propagated, your domain is live with email, calendar, Drive, and more, fully automated and secured. No manual checks, no delays.

  1. Send a POST request to /v1/domains with your domain (e.g., "example.com") and an optional organization name. This triggers the setup process, and Unifiedesk checks if the domain is valid and unused.
  2. Process validation happens instantly. If accepted, the API returns a JSON response including all required DNS records: MX, SPF, DKIM, and DMARC. You’ll get exact values, not just templates—this eliminates setup errors.
  3. Update your DNS provider using either the web UI or API. Tools like Cloudflare’s API or AWS Route 53 let you automate this step. Just paste the provided values into your DNS zone file.
  4. Wait for propagation. DNS changes typically propagate within minutes—commonly under 10. Use tools like MXToolbox to verify the records are live.
  5. Domain becomes active with full functionality: email, calendar, Drive, contacts, and video meetings are ready. No login delay, no manual verification steps.

What You Get Automatically

Once DNS is set, Unifiedesk automatically handles the rest. No need to manually approve domains, run tests, or wait for confirmation emails. Everything—mail routing, DKIM signing, calendar sync, file access—works out of the box.

For developers, this means you can embed domain setup in a deployment pipeline. Let’s say you’re onboarding a new client. Your script sends the domain, reads the response, updates DNS via Cloudflare API, and within minutes, the new user has access to full workspace tools: email, calendar, meetings, and Drive, all under their own domain.

Security and Control

All data is encrypted at rest with AES-256-GCM using per-account keys in self-hosted deployments. In the hosted version, end-to-end encryption applies. You control every record—no third-party access to your domain’s mail flow. This is how modern, privacy-respecting email infrastructure works: automation without compromise.

And yes, you can use this same API to manage multiple domains in bulk. Whether you’re setting up for a team, agency, or client portal, the process stays the same: one request, one response, zero manual work.

What DNS Records Does Unifiedesk Generate for Your Domain?

You can automate custom domain email setup with Unifiedesk’s API by creating four essential DNS records: MX to route incoming mail to mail.unifiedesk.com (priority 10), SPF to authorize mail sending via include:_spf.unifiedesk.com, DKIM with a selector and public key for outbound message signing, and DMARC at _dmarc to enforce policies and report failures. All are generated instantly and validated via our onboarding flow — no manual guesswork.

Record-by-Record: What Each Does

Let’s break down each record so you know exactly what’s being set — and why it matters.

Complete DNS Record Reference

DNS Type Record Name Value / Content Purpose
MX yourdomain.com mail.unifiedesk.com Priority: 10 Directs incoming mail to Unifiedesk’s mail servers. Priority 10 ensures correct routing if multiple MX records exist.
SPF yourdomain.com v=spf1 include:_spf.unifiedesk.com ~all Authorizes Unifiedesk to send mail on your behalf. The ~all means soft-fail for unauthorized senders — common industry practice.
DKIM selector._domainkey.yourdomain.com example: k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA... Public key for signing outbound messages. The selector (e.g., "dkim1") is generated per domain and used in email headers.
DMARC _dmarc.yourdomain.com rua=mailto:[email protected]; pct=100; fo=1 Enforces policy on failed DMARC checks (e.g., spoofing). pct=100 means 100% of messages are evaluated; fo=1 generates reports for alignment failures.

These records align with RFC 7483 and RFC 7208, standards used across email security. They’re designed to reduce spam, improve deliverability, and verify domain ownership.

Use our Custom Domain Setup page to generate these live in minutes. When automated via API, your CI/CD pipeline can provision new domains seamlessly — ideal for SaaS, dev teams, or internal IT infrastructure. The same records apply whether you host internally or use the hosted Unifiedesk platform.

For self-hosted deployments, all mail and files are encrypted at rest with AES-256-GCM under per-account keys — a stronger guarantee than most third-party providers offer. Learn more about self-hosting security at our security page.

Security First: How DNS Updates Are Protected During Automation

Every DNS update via the Unifiedesk API happens over HTTPS with TLS 1.3, ensuring data can't be intercepted in transit. All requests require a valid API key or JWT tied to an admin or service account, and no sensitive data—like passwords or private keys—is ever logged. Rate limiting and IP whitelisting further protect your domain from abuse, making automation safe even in production environments.

TLS 1.3 Ensures Transit Security

When you automate DNS changes, every byte travels encrypted via TLS 1.3. This isn’t optional—it’s enforced by design. The same protocol used by financial institutions and high-assurance services protects your domain’s records during every API call. TLS 1.3 eliminates older, weaker handshake methods, reducing exposure to known attack vectors.

Authentication and Access Control Are Non-Negotiable

Let’s be clear: no API key, no access. Every request to update your domain’s DNS must carry a valid JWT or API key tied to a specific service account or admin role. This prevents unauthorized changes, even if the request reaches the server. You control who can update what—down to individual records like SPF, DKIM, or DMARC.

Even if a request slips through, Unifiedesk doesn’t store sensitive payloads in logs. We delete raw request bodies immediately after validation, so even if logs are audited, they can’t expose your configuration details.

For production use, you can enforce IP whitelisting to allow only trusted machines or servers to trigger updates. Combined with rate limiting, it stops bots or brute-force attempts cold. This layering of controls is standard in secure API design—see how Google Cloud’s security principles emphasize least-privilege access and encrypted transit.

Want to secure your custom domain in minutes and automate future changes safely? See how Unifiedesk handles custom domain setup with full visibility and control—no guesswork, no breaches. Whether you’re running a small team or a large org, your email and workspace stay private, compliant, and under your control.

Real Example: Scripting Domain Onboarding for a SaaS Platform

When a user signs up for your SaaS and enters their custom domain email (like [email protected]), your system calls Unifiedesk’s /v1/domains API endpoint. It returns the exact DNS records needed — SPF, DKIM, DMARC — which you then push via your cloud provider’s API (Cloudflare, Route 53). After a short wait, a webhook tells the user their domain is active and ready to test. This entire flow takes minutes, not days.

How the API Flow Works

  1. Upon signup, the user enters their custom email address, like [email protected]. Your system validates the format and proceeds.
  2. You make a POST request to Unifiedesk’s /v1/domains endpoint with the domain name. The API responds with all required DNS records — SPF, DKIM, and DMARC — ready for deployment.
  3. Using Cloudflare’s or AWS Route 53’s API, you programmatically create the returned DNS records. This is done in your backend, not manually by the user or admin.
  4. Once the records are deployed, you invoke a webhook endpoint on Unifiedesk’s side to confirm propagation. This triggers domain verification.
  5. After a 5-minute grace period (standard for DNS propagation), your system notifies the user: “Your email domain is now live. Test it in your dashboard.”

Why This Matters for Developers

Manual DNS setup is a top reason users abandon signups. Automating it reduces friction. You’re not just adding a feature — you’re enabling trust. A domain that works instantly feels like it belongs to the user. This is how real-world SaaS platforms scale private email integration.

For reference: DNS propagation delays are typically 1–5 minutes, though they can take longer in rare cases. The IETF’s RFC 1035 defines DNS record handling and TTL behavior — a solid baseline for expectation management.

Once the domain is verified, the user can fully use all Unifiedesk services: secure email, calendar, real-time video meetings, shared drives, documents, and a locally可控 AI assistant. You get the freedom to build without locking into a hosted email stack.

For setup instructions and API reference, see: Custom Domain Onboarding.

How to Set Up DNS Automation Without Human Intervention

You can automate custom domain email setup with Unifiedesk’s API by fetching DNS records during domain registration, programming your DNS provider’s API (like Cloudflare or AWS Route 53) to create those records, checking propagation via a third-party tool such as MxToolbox, then enabling the domain in Unifiedesk and provisioning the user—all within a CI/CD pipeline using Terraform or Ansible. No manual steps required.

Build the Automation Flow Step by Step

  • Start by calling the Unifiedesk API to retrieve the required DNS records (MX, SPF, DKIM, DMARC) for your domain during registration. This ensures you’re using the correct, up-to-date configuration.
  • Use your DNS provider’s API—Cloudflare, AWS Route 53, or Google Cloud DNS—to programmatically create those records. For example, use Cloudflare’s API to add a TXT record for DKIM with a single HTTP POST request.
  • After creating the records, initiate a background check or call an external service like MxToolbox’s DNS check to verify propagation across the internet. This step ensures the DNS changes are live before proceeding.
  • Only after validation, use the Unifiedesk API to enable the domain. This triggers the email system to accept inbound mail for that domain.
  • Finally, create the user account via the Unifiedesk API, assigning them access to email, calendar, Drive, and team tools. This completes the full onboarding loop.

Run This Entire Flow in Your DevOps Pipeline

Every step can be triggered automatically through CI/CD tools like GitHub Actions, GitLab CI, or Jenkins. Terraform or Ansible can manage the infrastructure state and apply DNS changes as code. This keeps configuration consistent, auditable, and reproducible.

Let’s say you’re launching a new product and need 100 branded email addresses. You can trigger the process with a single command. The system creates the domain, configures DNS, verifies reachability, enables Unifiedesk access, and creates users—fully automated, with no human touch.

For secure, private email and team collaboration, Unifiedesk supports the same automation from custom domain onboarding to full workspace setup. The entire stack runs under your control, whether in the cloud or on-premise.

Want to try it? Start with a free private email account and explore how automation powers real-world security and scale.

This automation reduces onboarding time from hours to seconds, while eliminating human error in DNS configuration—a known source of email delivery failure.

Why Self-Hosting Doesn’t Mean You Should Manually Handle DNS

You don’t need to touch DNS records by hand just because you’re self-hosting. The Unifiedesk API lets you automate domain setup—whether you run the service on-premise or in the cloud—saving time, reducing errors, and aligning with modern DevOps practices. Even with full control, manual DNS management introduces friction. Let’s break down why automation is still the smart move.

API-Driven Domain Setup Works Everywhere

Even when you self-host Unifiedesk, the same API you’d use in the cloud handles custom domain configuration. No exceptions. This means whether your instance runs on bare metal, a VM, or in a container cluster, the process stays consistent. You’re not trading control for repeatability—you’re gaining both.

Generating the required DNS records (MX, SPF, DKIM, DMARC) is as simple as calling POST /domains with your domain name. The API returns the exact records you need—complete with correct values, keys, and expiration hints. This isn’t guesswork. It’s reproducible.

Automate It With Your CI/CD Pipeline

Let’s say you’re onboarding a new customer or spinning up a staging environment. You don’t want to copy-paste DNS records into a domain registrar’s UI. That’s error-prone. Instead, run a script using the open-source Unifiedesk engine locally to generate the full record set. Then, deploy those records as part of your CI/CD pipeline—via Terraform, Ansible, or a custom shell script.

This approach follows industry standards. According to the SMTP standard (RFC 5321), DNS configuration for email delivery is a system-of-record, and manual entry is discouraged in production environments. Automation ensures consistency and auditability.

Once the records go live, your team doesn’t need to check a spreadsheet or wait on IT. The system validates, configures, and starts handling mail—fully secure, with end-to-end encryption enabled by default.

And yes, you retain control. The self-hosted instance runs entirely on your infrastructure. No third party sees your data. But you still get the benefits of automation—like faster onboarding, fewer misconfigurations, and full audit trails.

Whether you manage one domain or a thousand, the API treats them all the same. No manual overrides. No exceptions. That’s how you get private, secure email on your own domain—without the overhead of manual DNS.

How to Safely Store and Manage API Keys for Domain Automation

You should never hardcode API keys in your application. Instead, store them in environment variables or a secrets manager like HashiCorp Vault or AWS Secrets Manager. Assign each key the least privilege needed—only domain creation and DNS read access—and rotate them regularly. This reduces exposure if a key is leaked and keeps your automation setup secure by design.

Use a Secrets Manager or Environment Variables

  • Store API keys in environment variables during development and runtime—never in git or config files.
  • For production, use a dedicated secrets manager like AWS Secrets Manager or HashiCorp Vault for audit trails and encryption at rest.
  • Use the principle of least privilege: limit keys to only domain creation and DNS record retrieval, nothing more.
  • Automate key rotation using scripts or tools; never let a key live unchanged for months.

Rotate Keys and Enforce Access Control

  • Set a policy to rotate API keys every 90 days—or sooner if used in high-risk environments.
  • Deprecate old keys immediately after rotation and disable them on the provider side.
  • Monitor key usage with logs; revoke any key showing unexpected behavior, like sudden domain creation spikes.
  • Consider using short-lived tokens where available—this minimizes damage if a key is exposed.

According to the NIST Special Publication 800-53, centralized secret management and regular key rotation are foundational to secure system design.

Let’s say you’re automating custom domain setup for a team using Unifiedesk. Your API key should only be able to create domains and read DNS records—not modify billing, access user data, or disable accounts. That way, even if a key leaks, attackers can’t pivot to other parts of your infrastructure.

Unifiedesk’s API lets you do exactly this: create domains and verify DNS records programmatically, with full control over access. You can set up a pipeline that spins up a new domain in seconds, using a key with minimal permissions.

Whether you're managing a single domain or scaling across teams, safe key handling is not a feature—it's a necessity. Use environment variables for development, secrets managers for production, and automate everything to reduce human error.

For a secure, self-hostable workspace where you control every aspect of your email and data—without vendor lock-in—check out Unifiedesk’s self-hosting option, or get started with custom domain setup in minutes at our onboarding page.

Common Pitfalls and How to Avoid Them in Automated Setup

Automating custom domain email setup with an API sounds simple—until DNS propagation stalls, record types get swapped, or staging checks miss real-world quirks. The biggest mistakes? Skipping the 3–5 minute DNS wait, using A-records instead of TXT for SPF, and assuming a domain works in test without validating ownership. These are real, preventable failures that derail deployments. Let’s walk through the most common traps and how to sidestep them.

DNS Propagation Is Not Instant—Wait for It

You can’t rush DNS. Even after updating records via API, global propagation takes time—typically 3 to 5 minutes, sometimes longer. Skipping this delay and immediately checking mail flow will fail. Let’s be clear: if you’re testing delivery just after updating DNS, you’re testing the API, not the email. Use a tool like MXToolbox to confirm your records are live before proceeding.

Use Correct Record Types—No Exceptions

SPF uses TXT records, not A or CNAME. DKIM requires a TXT record with a specific selector. DMARC also relies on TXT. Mistaking one for another breaks email authentication and can land your messages in spam. The SPF specification is clear: only TXT is valid for SPF. Always double-check the record type before setting it via API.

Test Domain Ownership in Real Environments

Assuming a domain works in a staging environment leads to pain in production. If your staging setup doesn’t validate domain ownership the same way production does—say, due to different DNS or firewall rules—you’ll miss issues until users report no mail. For robust automation, include a full email round-trip test: send from your domain, receive in another inbox, verify DKIM/SPF pass. Even better, use a tool like Spamhaus’ lookup to validate SPF and DKIM alignment.

The path to a working custom domain isn’t just setting records—it’s validating that the entire chain works. You can use Unifiedesk’s automated domain setup to handle this reliably, with real-time DNS record generation (MX, SPF, DKIM, DMARC) and instant live checks. Whether you're building an internal tool or scaling a customer platform, avoid hand-holding and let the API guide you—but never skip the wait. Email isn’t magic. It’s just careful plumbing. And plumbing fails when you skip the wait, swap parts, or test in the wrong room.

The Bottom Line: Automation Is Not Optional for Modern Email Infrastructure

Manual DNS management breaks under scale. Every change is a potential misconfiguration, a delay, or a security gap.

Unifiedesk’s API eliminates that friction. With a single request, developers can provision a full email setup — domains, records, and user access — all programmatically.

From onboarding to delivery, every step is scriptable.

  • Automated DNS record creation (MX, SPF, DKIM, DMARC) with verified deployment
  • Instant user provisioning and domain ownership validation
  • Full audit trails for compliance and troubleshooting
  • Secure, encrypted mail flow from sender to inbox

Security, reliability, and traceability aren’t trade-offs — they’re defaults when automation is built in.

Keep reading

Ready to put this into practice? Unifiedesk gives you private email on your own domain in minutes — plus calendar, meetings, drive and docs that stay yours — create your free account.

Frequently asked questions

Can I automate DNS record setup for multiple domains at once?

Yes — the Unifiedesk API supports bulk domain registration via a single request, with each domain returning its own DNS record set.

Does the API handle DNS propagation checks?

No — the API returns DNS records immediately, but you must verify propagation using your DNS provider’s API or a third-party check.

What happens if I make a mistake in a DNS record?

Unifiedesk enforces record validation and flags invalid configurations during setup. You can reissue the request with corrected data.

Can I use the API to deactivate a domain I no longer need?

Yes — the API provides a delete method to remove a domain and its associated records without manual cleanup.

Is the API available for self-hosted Unifiedesk?

Yes — the same API is available in self-hosted deployments, enabling full automation regardless of infrastructure location.

Do I need a paid plan to use the API?

Yes — API access is available on paid tiers, which include unlimited domains and admin controls.

Can I use this API to integrate with my own user onboarding system?

Yes — many developers use the API to tie domain provisioning to user accounts in SaaS platforms, intranets, or customer portals.

What happens if my DNS provider doesn’t support TXT or MX records?

All major DNS providers (Cloudflare, AWS Route 53, Google Cloud DNS, etc.) support TXT and MX. Use a provider that does.

Is data from the API used to train AI models?

No — Unifiedesk’s AI assistant does not use email content or DNS data from the API for training.

How long does it take for email to work after DNS setup?

Once DNS records are propagated (typically within minutes), email delivery begins immediately. Some providers queue mail for up to 30 minutes.

Can I preview DNS records before deploying them?

Yes — the API returns the full set of records as JSON, which you can inspect or log before pushing to your DNS provider.

Does Unifiedesk support subdomain email setup via API?

Yes — you can register any subdomain (e.g. [email protected]) using the same API, with records generated automatically.