Connecting a custom domain to a hosted web app is usually a matter of matching the hosting provider’s target with the correct DNS record, then verifying TLS, redirects, and application routing. This reference explains what to configure, what to monitor, and how to diagnose common DNS errors without guessing.
Overview
A custom domain gives users a stable address for an app hosted on a cloud platform, app builder, virtual server, or serverless service. The domain itself is managed through a registrar and its DNS records are managed either there or through a separate DNS provider. The hosted app, meanwhile, has a destination such as an IP address or provider-generated hostname. DNS connects those pieces.
The exact dashboard labels differ between providers, but the underlying tasks are consistent:
- Confirm which hostname the hosting platform expects.
- Create the required A, AAAA, or CNAME record.
- Remove conflicting records for the same hostname.
- Add the domain in the app’s hosting dashboard and complete verification.
- Enable or confirm a TLS certificate and test HTTP-to-HTTPS behavior.
- Check the root domain,
www, and any staging or API subdomains separately.
Do not change nameservers simply because a provider mentions DNS. A service may ask you to add records at your existing DNS host, or it may ask you to delegate the domain by replacing nameservers. These are different operations. Before making a change, record the current DNS configuration, especially MX, TXT, SPF, DKIM, and DMARC records used for email.
For wider launch checks, pair this guide with the production readiness checklist for cloud apps. DNS is only one part of a reliable deployment.
What to track
Build a record plan before editing DNS
Write down the intended hostnames and their destinations first. This prevents an accidental record replacement and makes later troubleshooting easier.
| Hostname | Typical record | Destination | Purpose |
|---|---|---|---|
@ or the bare domain | A or provider-supported ALIAS/ANAME | Hosting IP or apex-compatible target | Main site, such as example.com |
www | CNAME | Provider hostname or canonical site hostname | Common alternate web address |
app, staging, or another subdomain | CNAME, sometimes A | Environment-specific hosting target | Application or preview environment |
api | CNAME or A | API gateway, load balancer, or backend host | Separate API endpoint |
| Mail-related hosts | MX, TXT, CNAME | Email provider’s supplied values | Mail delivery and authentication |
A records point a hostname to an IPv4 address. A CNAME points a hostname to another hostname. A CNAME is often appropriate for a subdomain such as www.example.com or app.example.com, while the root domain has provider-specific limitations and may require A records or an ALIAS/ANAME-style feature. Follow the hosting platform’s instructions rather than substituting a record type based on its name alone.
Do not create a CNAME and an A record for the same hostname. Also check for duplicate A, AAAA, or CNAME records left by an older host. Multiple records can be intentional for load distribution, but they should match the provider’s documented design. An outdated address can produce intermittent results when different resolvers receive different answers.
Track the domain’s application and certificate status
DNS resolution does not automatically configure the app. The domain usually must also be added in the hosting platform’s project settings. Some platforms require a verification TXT record; others verify that the web record points to the expected target. Keep a record of whether each hostname is marked pending, verified, active, or failed.
TLS is a separate checkpoint. A certificate must cover the exact hostname users visit. A certificate for www.example.com does not necessarily cover example.com, and a certificate for the production domain does not automatically cover staging.example.com. Check certificate status after DNS verification and after adding any new subdomain.
Protect email records
Web hosting changes should not overwrite email records. MX records control mail delivery, while TXT records commonly support domain verification and email authentication. Before changing nameservers, export or copy every existing record. After the change, verify that mail-related records still exist at the new DNS provider. A web-domain migration that appears successful can still disrupt email if these records were omitted.
Cadence and checkpoints
Use a short checklist for every new domain connection, registrar migration, staging hostname, or hosting move. A monthly or quarterly review is useful for production apps with frequent deployments, multiple environments, or shared ownership.
At initial setup
- Confirm the exact domain and environment. Avoid pointing a production domain at a preview or staging project.
- Lower the DNS TTL only if you have a planned change and understand the provider’s guidance. TTL affects how long recursive resolvers may retain an answer; it does not force every cache to refresh immediately.
- Capture the existing zone records before editing.
- Add only the records supplied by the hosting provider.
- Verify the domain in the hosting dashboard.
- Wait for certificate issuance or activation, then test HTTPS.
- Test both the root domain and
www, plus each intentionally supported subdomain.
During a recurring review
- Compare DNS records with the current architecture and remove obsolete hosting targets.
- Check that production and staging hostnames still point to the intended environments.
- Review certificate status, expiration information, and automatic renewal indicators where available.
- Confirm the preferred canonical hostname and redirect behavior.
- Check that email records and domain-verification TXT records remain present.
- Run resolution checks from more than one network or resolver when an issue appears intermittent.
Useful command-line checks include dig example.com, dig www.example.com, and dig CNAME www.example.com. On systems without dig, nslookup example.com provides a comparable basic lookup. To inspect the HTTP response and redirect chain, use curl -I http://example.com and curl -I https://example.com. Look for the expected status, Location header, and host-specific response. These commands show what a resolver or web server returns; they do not replace the hosting provider’s domain verification screen.
How to interpret changes
Diagnose one layer at a time: DNS, hosting association, TLS, then application redirects. This avoids treating every browser error as a DNS problem.
Wrong-host or default-site response
If DNS resolves but the server shows a provider landing page, another project, or a default virtual host, the record may point to the wrong destination or the domain may not be attached to the intended app. Compare the resolved target with the hosting dashboard, then confirm the exact hostname is listed in the project settings.
Certificate mismatch or HTTPS warning
First confirm that DNS points to the intended host and that the hostname has been verified. Check the certificate for the exact address in the browser or with a suitable TLS inspection tool. A missing certificate for the apex domain, an unsupported wildcard assumption, or a stale proxy configuration can cause a mismatch. Do not treat bypassing the warning as a fix.
Redirect loop
Inspect the full redirect chain with curl -I. A loop can occur when the app forces HTTPS while an intermediary tells the app that the original request was HTTP, or when both the hosting platform and application enforce conflicting canonical URLs. Keep one clear HTTPS policy and verify the platform’s forwarded-protocol settings before changing application code.
Intermittent resolution
Compare answers from different resolvers and inspect all A and AAAA records. An old record, an incorrect IPv6 address, or a partially completed nameserver migration may cause different users to reach different destinations. Also consider caching: recent DNS changes can remain visible for a period based on prior TTL values.
Email stopped after a web change
Review MX and related TXT records immediately. If nameservers changed, ensure the complete email configuration was recreated at the authoritative DNS provider. Avoid deleting mail records to make room for web records; they serve different purposes and can coexist.
For related operational checks, see the cloud app observability checklist and the disaster recovery checklist. They help distinguish a domain problem from an application or infrastructure problem.
When to revisit
Revisit this reference whenever you connect a custom domain to a new hosted app, add a staging or API subdomain, migrate registrars or nameservers, change hosting providers, introduce a CDN or proxy, renew or replace certificates, or alter the app’s canonical URL. These events can change the correct record type, target, verification method, or TLS behavior.
For an established production app, schedule a monthly or quarterly DNS and domain review. Record the date, responsible owner, authoritative nameservers, intended records, certificate status, and test results. Refresh the record plan when infrastructure changes, and update internal runbooks if your provider changes dashboard terminology or verification steps.
Before closing a DNS change, run this practical final check:
- Resolve the root domain and every supported subdomain.
- Confirm each result maps to the intended environment.
- Open HTTP and HTTPS versions and inspect redirects.
- Verify the certificate covers the exact public hostname.
- Test a representative app route, not only the homepage.
- Confirm email delivery records were not altered.
- Document the final records, timestamp, and rollback plan.
Keeping this small inventory current turns custom-domain setup from a one-time guess into a repeatable deployment control. When a DNS error appears later, the recorded baseline makes it much easier to identify what changed.