A hosting provider asks the owner of a website to add a DNS record. The form offers A, AAAA and CNAME. Each option appears to be a way to make a name lead somewhere, and choosing the wrong one can interrupt a website that was working perfectly five minutes ago.
An A record maps a name to an IPv4 address, an AAAA record maps it to an IPv6 address, and a CNAME aliases a name to another name. The correct choice depends on what the destination provider actually supplies and how the authoritative DNS service handles that name. Cloudflare’s DNS record reference describes those record types; other DNS providers may present and implement their controls differently.
This is a way to understand the decision before changing it. It is not a universal migration recipe. Mail, verification, certificates, proxy settings and the current hosting arrangement may depend on records that have nothing to do with the particular website address being changed.
The address record answers an address question
Imagine a fictional host called www.example.com. An A record for that name can return an IPv4 address such as 192.0.2.10, a documentation example used here rather than a real destination. An AAAA record can return an IPv6 address such as 2001:db8::10, also an example address. A client and its network decide how to use the addresses they receive.
The two record types are not interchangeable text fields. An IPv4 address belongs in an A record; an IPv6 address belongs in an AAAA record. A website can have both, but adding an IPv6 address that does not actually serve the intended site can create failures for clients that try that path. Do not add a record merely to make a dashboard look complete.
More than one address can be published for a name, depending on the provider and setup. That does not, by itself, prove that traffic is balanced evenly, that each destination is healthy, or that a failover plan will work. DNS caching, client behavior, provider configuration and the actual service behind each address all matter.
A DNS answer is also not a complete website configuration. The server must recognize the requested hostname, and HTTPS requires an appropriate certificate and working TLS configuration. A correct address record can lead a visitor to a server that is reachable but does not serve the intended site.
An alias points to a name
A CNAME connects one domain name to another canonical name. In a simplified illustration, www.example.com aliases to site.host.example.net. A resolver can then continue the lookup to find the relevant answer for the target. The target is a hostname, not an IPv4 address placed into a CNAME field.
This is useful when a hosting provider gives a customer a hostname and manages the addresses behind it. If the host changes the target’s address, the alias can continue to point to the same target name. That convenience still depends on the hosting provider keeping the target configured and recognizing the customer’s hostname.
Do not interpret a CNAME as a visible web redirect. A browser may continue to display the original address, and the web application still receives a request for the original hostname. A redirect is an HTTP response configured by a web service; a DNS alias is part of name resolution. The two can be used together, but creating one does not automatically create the other.
Similarly, a CNAME to a functioning host does not automatically issue a certificate for the alias. A platform may need a domain-connection step or validation record before it will accept the name securely. Follow the current destination provider’s instructions for the exact hostname rather than guessing from a different customer’s setup.
The root name has special constraints
The zone apex is the root of a DNS zone, often displayed as @ in a provider’s form. For a zone named example.com, that means the name example.com itself. The separate name www.example.com is a subdomain. A change to one does not automatically configure the other.
Ordinary DNS CNAME behavior conflicts with the need for other data at the same owner name, and the zone apex necessarily has records such as SOA and NS. DNS providers therefore use different approaches when a hosting service wants an alias-like target at the apex. Some offer ALIAS or ANAME features; Cloudflare documents CNAME flattening, which can resolve a configured target and return address records instead of an ordinary CNAME answer.
Those features are provider-specific conveniences, not permission to assume every DNS service supports the same apex entry. A dashboard may accept an alias-like setting while public DNS answers show A or AAAA records. Read the provider’s documentation and test the public result. If the host provides fixed addresses instead, confirm whether it expects those addresses for the root, the subdomain, or both.
One name can have other jobs
Before changing a record, inventory the current zone and identify what each relevant name does. Website address records are not the same as MX records for mail routing, TXT records used for various validations, or CAA records that can constrain certificate issuance. Deleting or replacing unrelated records to “clean up DNS” can affect services well beyond the website.
A CNAME at a name also has rules about coexistence with other DNS data at that same name. Provider dashboards may prevent an invalid combination, flatten it, or apply provider-specific behavior. Treat an existing conflict message as a reason to understand the actual records and provider instructions, not as an invitation to remove every record with the same label.
For a planned move, preserve a private record of the existing names, types, values, TTLs and any provider-specific proxy settings before changing the approved target. Identify the authoritative DNS service: editing a registrar’s unused zone will not change the answers served by another provider. If ownership or the active service is unclear, resolve that question before writing.
Why two people may see different answers
DNS responses can be cached. A time to live, or TTL, tells resolvers how long a response may be cached under applicable rules. A change at the authoritative provider does not force every recursive resolver or client to discard an earlier answer immediately. Some services also cache negative answers or apply their own behavior.
Suppose the old answer had a 30-minute TTL. Lowering the TTL immediately before a cutover does not retroactively shorten a copy already cached under the earlier value. The old answer can still be seen until that cache’s remaining lifetime expires, subject to the resolver’s behavior. A later check from one device is a useful observation, not proof that everyone sees the same result.
Our guide to DNS caching and TTL explains the timing problem in more detail. For a consequential change, plan verification from the authoritative answer through representative recursive resolvers and the actual website. Record when and where each result was observed, and keep the old service available for an appropriate transition when the migration plan permits.
For example, a company might move only www.example.com to a new host while keeping its mail service and the root domain where they are. That plan requires checking the exact www record and the hosting platform’s binding for that hostname. It does not imply that the MX records, the root A record, or every verification TXT record should change. If the company later wants the root address to redirect to www, that is a separate destination and web-server decision. Test each hostname individually, because a working subdomain cannot prove that the root name or email service still works.
Read the answer and the website separately
A successful DNS lookup establishes an answer from the resolver queried at that moment. It does not establish that the site’s home page, login, checkout, certificate and every subdomain work. After an authorized change, check the intended hostname over HTTPS, inspect certificate and browser behavior, and test the affected routes in scope. Compare the result with the expected destination and preserve observations with timestamps.
If the lookup is correct but the website fails, investigate the host’s domain binding, TLS status, proxy or application configuration rather than repeatedly changing DNS at random. If the public answer is wrong, check the zone, spelling, record name, active nameservers, caches and any proxy or flattening behavior. Each clue points to a different layer.
Before acting, write down the precise question: does the host require an address, or does it require a name? Then identify the exact hostname and the authoritative provider. A, AAAA and CNAME are small records with an outsized role; treating them as distinct instructions makes a migration much easier to reason about.
Explore Infinite Upside
For Vijay Sheth’s personal accounts, read Infinite Upside: Building Wealth With Room to Live, published by Sheth Capital, Inc.
Explore a related guide
Why does a DNS change appear at different times?