Custom Domains for SaaS Apps: DNS, TLS, Verification, and Migration Checklist
custom domainsDNSTLSSaaShostingdomain migration

Custom Domains for SaaS Apps: DNS, TLS, Verification, and Migration Checklist

AAppCraft Studio
2026-11-21
8 min read

A practical guide to DNS records, domain verification, TLS, tenant subdomains, redirects, troubleshooting, and SaaS domain migrations.

Connecting a custom domain to a SaaS application involves more than adding one DNS record. This guide explains how to plan DNS, domain verification, TLS certificates, tenant subdomains, redirects, email safeguards, and migrations so customers can reach the correct application without avoidable downtime or certificate errors.

Overview

A custom domain usually sits across four systems: the registrar where the domain is managed, authoritative DNS, the SaaS or hosting platform serving the application, and the certificate authority or certificate manager providing TLS. A successful setup requires all four to agree on ownership, routing, and the hostname that users will visit.

The exact labels in a hosting dashboard vary, but the underlying workflow is broadly consistent:

  1. Decide which hostname will serve the application.
  2. Confirm the hosting platform supports that hostname and its certificate requirements.
  3. Add the requested DNS record or records.
  4. Complete domain verification, usually with a DNS or HTTP challenge.
  5. Wait for TLS provisioning and test both secure access and redirects.
  6. Monitor the configuration and document how to remove or change it safely.

Keep application routing separate from email routing. A web host may ask you to change an A or CNAME record, while mail depends on MX, SPF, DKIM, and DMARC records. Replacing a complete DNS zone with a provider-generated template can unintentionally disrupt email, verification services, analytics, or other subdomains.

For SaaS teams, custom-domain support should also be treated as an application feature. The platform must know which customer owns a hostname, route requests to the correct tenant, issue certificates where supported, and reject unverified or abandoned domains. DNS alone cannot provide that tenant-level authorization.

What to track

DNS record types and their jobs

Use this provider-neutral reference before making a change. The value and limitations depend on your DNS provider and hosting platform.

RecordTypical purposePractical caution
AMaps a hostname to an IPv4 address.Use the exact address supplied by the host. A stale address can send traffic to an old deployment.
AAAAMaps a hostname to an IPv6 address.Only add it when the destination is intentionally configured for IPv6. An incorrect AAAA record can cause some users to fail while others succeed.
CNAMEPoints a hostname to another hostname, commonly a platform target.It is generally used for subdomains, not the bare apex domain, though DNS providers may offer special flattening behavior.
ALIASA provider-specific or provider-supported way to point an apex domain to a hostname.Terminology and behavior vary. Some dashboards call similar functionality ANAME or CNAME flattening.
TXTProves domain control and stores text-based policy or verification data.Preserve unrelated TXT values. SPF, verification tokens, and other records may coexist but should not be casually overwritten.
CAAStates which certificate authorities may issue certificates for a domain.An overly restrictive CAA policy can prevent a hosting platform from issuing or renewing its certificate.

Hostname patterns for SaaS tenants

Choose a pattern that matches your product and certificate strategy. A platform-owned application might use app.example.com, while customer-specific environments may use customer.example.com or a customer-owned domain such as portal.customer-domain.com. A wildcard pattern such as *.example.com can simplify coverage for subdomains, but wildcard support, validation, and certificate issuance differ by platform. Confirm the limits before designing onboarding around it.

For customer-owned domains, store at least the hostname, tenant identifier, verification status, verification method, certificate status, creation date, last validation time, and intended canonical URL. Do not treat a DNS record as proof that the customer is authorized to use a hostname until the platform has completed its verification process.

Domain verification and TLS status

Track verification and TLS separately. A domain can be correctly pointed at your application but still show a certificate error, or it can have a valid certificate while routing to the wrong tenant. Useful states include pending DNS, verified, certificate pending, active, renewal warning, suspended, and removed. These states make support messages more precise than a single generic connected or disconnected label.

Cadence and checkpoints

Step 1: Choose the canonical hostname

Decide whether users should access www.example.com, example.com, or another hostname. Select one canonical version and redirect the alternative. For a SaaS tenant, also decide whether the customer domain is the primary public URL or merely an alias. Record this decision before editing DNS.

Step 2: Prepare the hosting platform

Add the hostname in the application or hosting dashboard before changing DNS when the platform allows it. The dashboard may provide a target hostname, IP address, TXT verification value, or instructions for certificate issuance. Confirm that the hostname is attached to the correct project and tenant, not just to a shared account.

Step 3: Add the smallest necessary DNS change

At the registrar or DNS provider, add only the records requested by the platform. For a subdomain, this is often a CNAME. For an apex domain, the platform may request A records, an ALIAS or ANAME-style record, or a redirect from the apex to a subdomain. Avoid deleting existing records unless you have an exported zone file and have confirmed their purpose.

Step 4: Complete verification

If the platform requests a TXT record, copy the name and value exactly. DNS interfaces may automatically append the domain name, so check whether the dashboard expects a relative label or a fully qualified name. If verification uses an HTTP file or route, confirm that the application or redirect rules do not block the challenge path.

Step 5: Provision and test TLS

Wait for the platform to issue the certificate, then test the HTTPS URL in a private browser session and with a command-line request if available. Check the exact hostname, the certificate name, the redirect from HTTP to HTTPS, and behavior for both the canonical and noncanonical hostnames. Do not assume that a successful DNS lookup means TLS is ready.

Step 6: Test tenant isolation and application behavior

Open the custom domain while logged out, log in as a test user, and inspect links, cookies, password-reset URLs, webhooks, and API callbacks. Confirm that a request for Tenant A cannot display Tenant B content because of a host-header or routing mistake. If your app uses hostnames in authentication or integrations, update its allowed-origin and callback configuration deliberately. For token-related troubleshooting, keep domain changes separate from token validation; a useful reference is the JWT debugging guide.

Step 7: Record the checkpoint

Save the final DNS records, platform project, certificate status, owner, and rollback plan in an operational record. Include the date of the last successful test and the next review date. This is particularly important when several app development platforms, deployment services, or DNS providers are used across environments.

How to interpret changes

Propagation is not the same as caching everywhere

DNS resolvers cache answers according to TTL, but different resolvers may refresh at different times. A local result and a public result can therefore disagree temporarily. Query the authoritative nameservers and compare results from more than one external resolver before concluding that a record is wrong. Also check the record at the exact hostname: the apex, www, and a tenant subdomain can each have different answers.

If a change appears stuck, inspect these common causes:

  • The record was added at a registrar that is not authoritative for the domain.
  • A CNAME is present where another conflicting record exists.
  • An old A or AAAA record is still serving some traffic.
  • The platform expects a trailing dot, exact token, or different hostname label.
  • A proxy or CDN is hiding the origin response.
  • The certificate request is waiting for verification or is blocked by a CAA policy.
  • The application redirects to a hostname that has not yet been configured.

Redirects and email records need separate review

Use one clear redirect policy: for example, redirect HTTP to HTTPS and redirect the alternate hostname to the canonical hostname. Avoid chains such as old domain to www to a tenant URL. Test query strings and important paths so that a redirect does not silently discard campaign parameters or deep links.

Do not change MX records as part of a web-domain setup unless you are intentionally moving email. Preserve MX, SPF, DKIM, and DMARC records, and check whether a new TXT value conflicts with an existing SPF policy. If the same domain serves both email and the SaaS application, document which team owns each record before migration.

Migration checklist

  • Lower the relevant TTL ahead of a planned migration when appropriate, without assuming this removes all cached answers.
  • Export and review the current DNS zone.
  • Inventory web, email, verification, API, and third-party records.
  • Configure the destination application and certificate before switching traffic.
  • Verify the new domain with a test hostname or controlled window.
  • Change traffic records while keeping the old service available during validation.
  • Test HTTPS, redirects, login, callbacks, assets, webhooks, and tenant routing.
  • Monitor errors and certificate status, then remove obsolete records only after the rollback window.

When to revisit

Review this setup monthly or quarterly for active SaaS products, and immediately after a hosting, registrar, DNS, certificate, branding, or tenant-routing change. A recurring review should confirm that each active domain still belongs to the intended tenant, resolves to the intended platform, has a valid certificate, redirects consistently, and does not depend on an abandoned service.

Revisit the implementation before launching a custom-domain feature, adding wildcard support, changing deployment platforms, introducing a CDN, or moving email. Platform instructions and dashboard terminology can change, so refresh your runbook at least every six months and after a major hosting change.

For the next domain you connect, use this short action list: identify the canonical hostname, export the existing DNS zone, add only the requested records, verify ownership, wait for TLS, test routing and email separately, and record the final state. If the change is part of a broader deployment migration, pair this review with your SaaS deployment cost checklist and your full-stack deployment checklist. Treat every domain as an operational dependency, not a one-time configuration, and future migrations will be easier to diagnose and safer to reverse.

Related Topics

#custom domains#DNS#TLS#SaaS#hosting#domain migration
A

AppCraft Studio

App Development Editor

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.