DNS Records for Web Developers: A, AAAA, CNAME, TXT, MX, and Verification Workflows
dnsdomainshostingdeploymentemailapiwebhookstroubleshooting

DNS Records for Web Developers: A, AAAA, CNAME, TXT, MX, and Verification Workflows

FFuzzy Website Editorial Team
2026-11-17
7 min read

A practical DNS checklist for connecting domains to APIs, apps, email, webhooks, and verification services without guesswork.

Connecting a domain to an API, webhook receiver, authentication service, email provider, or hosted application usually starts with one question: which DNS record belongs here? This practical checklist explains A, AAAA, CNAME, TXT, and MX records, shows how to verify the authoritative nameservers before making a change, and provides a repeatable workflow for diagnosing cached or incomplete DNS updates.

Overview

DNS translates a human-readable hostname such as api.example.com into information that clients can use to connect to a service. For backend and API work, that information may point a hostname to an IPv4 address, an IPv6 address, another hostname, an email system, or a verification value supplied by a hosting or security provider.

The right record depends on what the provider gives you. Do not substitute an A record for a CNAME simply because both appear to “point” somewhere. A record stores an IP address; a CNAME stores another hostname. Similarly, a TXT record does not route web traffic. It proves control of a domain or publishes text-based configuration for a service.

RecordUse it forValue looks like
APointing a hostname to an IPv4 address203.0.113.10
AAAAPointing a hostname to an IPv6 address2001:db8::10
CNAMEAliasing a hostname to another hostnameapp.host.example
TXTDomain verification and text-based service configurationprovider-verification=...
MXChoosing mail servers for a domainmail.example.net with priority

DNS records are separate from application routing. DNS can direct api.example.com to a server, but it does not decide whether /v1/users reaches one API handler and /webhooks/payment reaches another. That happens through your reverse proxy, load balancer, CDN, or application configuration. DNS also does not replace TLS: HTTPS still requires a certificate that covers the hostname.

Checklist by scenario

Connecting a domain to a web app or API

  1. Read the hosting provider’s exact instruction and identify the hostname it wants you to configure. The root domain, often written as @, is different from www or api.
  2. Use an A record when the provider gives you a stable IPv4 address. For example, api.example.com A 203.0.113.10.
  3. Use an AAAA record only when the provider gives you an IPv6 address and the service is correctly reachable over IPv6. Do not invent an IPv6 value or copy an unrelated address.
  4. Use a CNAME when the provider gives you a hostname, such as project.host.example. The record might be api CNAME project.host.example.
  5. Complete the provider’s domain verification step, then configure the application or gateway to accept the new hostname.
  6. Issue or attach a TLS certificate before treating the endpoint as production-ready. Test both the expected HTTPS URL and the application’s health endpoint.

A CNAME cannot normally coexist with other record types at the same name. If api.example.com already has A, AAAA, TXT, or other records, review the existing setup before replacing it. At the root domain, some DNS providers offer provider-specific aliasing or CNAME-like behavior; follow that provider’s documented interface rather than assuming ordinary CNAME rules apply.

Adding a webhook or callback endpoint

  1. Create a dedicated hostname such as hooks.example.com or events.example.com instead of changing the hostname used by your main site without a rollback plan.
  2. Point the hostname using the record type supplied by your hosting, ingress, or CDN provider.
  3. Confirm that the backend route, HTTP method, authentication, and signature verification match the webhook sender’s configuration.
  4. Test DNS resolution first, then test an HTTPS request with a representative payload. DNS success does not prove that the endpoint returns the correct status code.

For the application-side portion of this workflow, see the Webhook Debugging Guide. If the request reaches the server but fails in the browser, separate DNS issues from CORS and application errors with the CORS debugging workflow.

Verifying domain ownership

  1. Copy the provider’s requested record type, host or name, and value exactly.
  2. Add a TXT record at the requested name. A root-domain verification may use @; a service may request a name such as _verify or a longer tokenized label.
  3. Preserve punctuation, underscores, capitalization where relevant, and the complete token. Do not add quotation marks unless the DNS interface requires them.
  4. Check whether an existing TXT record is already present. Multiple TXT records can be valid, but do not overwrite unrelated SPF, verification, or service records.
  5. Wait for the provider’s checker to see the value, then remove temporary verification records only if the provider says they are no longer needed.

TXT records are also used by email systems and other services. Treat them as shared configuration rather than disposable notes, particularly on a domain used for production email.

Connecting email

  1. Add the MX records specified by the email provider, including each server’s priority if supplied.
  2. Keep existing MX records unless you are intentionally migrating mail. Multiple MX records may be part of one provider’s design; mixing providers accidentally can send mail to the wrong system.
  3. Review any requested SPF, DKIM, or DMARC-related TXT records separately. These records support email authentication but do not replace MX records.
  4. Test inbound and outbound mail after the change, and document the previous records for rollback.

What to double-check before changing production DNS

  1. Find the authoritative nameservers. The DNS dashboard you opened may not be the system currently serving the domain. Use a registrar lookup or a command such as dig NS example.com, then identify the nameservers listed as authoritative.
  2. Inspect the current record. Run dig A api.example.com, dig AAAA api.example.com, dig CNAME api.example.com, or dig TXT example.com as appropriate. On Windows, nslookup provides a comparable basic check.
  3. Check the record name format. Some control panels append the domain automatically. Entering api.example.com into a field that already appends .example.com can create an unintended name.
  4. Record the TTL and existing values. TTL controls how long resolvers may cache an answer. A change is not necessarily visible everywhere immediately, especially while older answers remain cached.
  5. Check every address family. An incorrect AAAA record can cause some clients to attempt IPv6 while others use IPv4 successfully. This can look intermittent even when the A record is correct.
  6. Check the final HTTPS path. Resolve the hostname, connect with HTTPS, inspect the certificate hostname, and make a real request. For API diagnosis, the Chrome DevTools Network guide and HTTP status code guide help distinguish transport problems from backend responses.

For a controlled comparison, query more than one recursive resolver and query the authoritative server directly when possible. Different answers do not automatically mean the record is wrong; they may reflect cache age, resolver behavior, or a delegated-zone problem. If authoritative answers are wrong, changing local cache settings will not fix the issue.

Common mistakes

  • Using an A record for a hostname. If a provider gives you a hostname, do not resolve it once and hard-code the resulting IP unless the provider explicitly instructs you to do so. The provider may change that address.
  • Changing the wrong DNS provider. Editing records at the registrar has no effect if the domain delegates DNS to separate nameservers.
  • Overwriting the zone. Replacing all records with a provider’s short example can remove mail, verification, staging, or unrelated subdomain configuration.
  • Assuming propagation is the only problem. A wrong record name, incorrect nameserver delegation, failed TLS setup, blocked port, or application routing error will remain wrong after caches expire.
  • Adding an AAAA record without testing IPv6. Clients that prefer IPv6 may fail while IPv4 users appear healthy.
  • Testing only the root domain. example.com, www.example.com, api.example.com, and hooks.example.com are independent names and may have different records.
  • Confusing DNS with CORS or authentication. A hostname resolving correctly does not authorize a request, validate a JWT, or make a browser permit cross-origin access.

When to revisit

Revisit this checklist before a production launch, API migration, CDN or hosting change, certificate renewal, email-provider change, new webhook integration, or addition of a subdomain. It is also worth reviewing during an incident when users report that a service works from one network but not another.

Make DNS changes repeatable: store the intended records in deployment documentation or infrastructure-as-code where appropriate, note the owner of each record, and keep a rollback value. Before a planned migration, lower the relevant TTL only if your operational plan benefits from doing so; lowering it does not instantly remove answers already cached under the previous TTL.

When a resolution problem appears, follow this order:

  1. Confirm the hostname and record type.
  2. Query the authoritative nameserver.
  3. Compare results from more than one resolver.
  4. Check A and AAAA answers, TLS, and the actual application response.
  5. Inspect backend logs and proxy configuration only after confirming that traffic can reach the intended endpoint.

This sequence keeps DNS, transport security, browser policy, and application behavior separate. That makes domain changes safer and gives you a clear next step when the symptom is not actually a DNS problem.

Related Topics

#dns#domains#hosting#deployment#email#api#webhooks#troubleshooting
F

Fuzzy Website Editorial Team

Technical 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.