One hostname can cross several aliases before DNS reaches the address a client uses. During a CDN or hosted-service cutover, the first CNAME may point to the expected provider while a later hop lands on an unexpected platform or never reaches the required address record.
Query the client-facing hostname for the same record type the client needs. An A or AAAA question lets a recursive resolver follow visible CNAME hops toward the terminal address, while a CNAME question normally returns only the first alias because that record type already answers the original question.
A named public resolver keeps every lookup in one DNS view while the chain is inspected. Alias targets, addresses, and cache TTL values can differ by resolver, location, or query time, so follow the names returned by the first lookup instead of expecting the sample values to remain fixed.
Related: How to query DNS records with dig
Related: How to show short DNS answers with dig
Related: How to trace DNS delegation with dig
Tool: Trace CNAME Alias Chain
$ dig @1.1.1.1 www.microsoft.com A +noall +answer www.microsoft.com. 3584 IN CNAME www.microsoft.com-c-3.edgekey.net. www.microsoft.com-c-3.edgekey.net. 884 IN CNAME e13678.dscb.akamaiedge.net. e13678.dscb.akamaiedge.net. 4 IN A 23.193.226.97
Each CNAME row maps its owner name to the next target. The final A row is the terminal IPv4 answer. Resolver-cache TTL values count down, and a CDN may return different targets or addresses from another location.
$ dig @1.1.1.1 www.microsoft.com CNAME +noall +answer www.microsoft.com. 2315 IN CNAME www.microsoft.com-c-3.edgekey.net.
A CNAME question is already answered by the first alias record, so it does not display the later hop or terminal address returned by the A question.
$ dig @1.1.1.1 e13678.dscb.akamaiedge.net A +noall +answer e13678.dscb.akamaiedge.net. 7 IN A 23.193.226.97
The target in this command is the final CNAME name from the first lookup. A matching terminal address confirms that the chain settles on the address returned for the client-facing hostname.