A domain name is not a single answer. DNS stores records, and the type in the question decides which answer a resolver asks for. RFC 1035 names the old workhorses: A, CNAME, MX, and TXT among them.[1]
RFC 1035, Domain names: implementation and specificationA, CNAME, MX, and TXT record definitions IPv6 later added AAAA.[2]
RFC 3596, DNS extensions to support IPv6The AAAA record definition
example.com. A 192.0.2.42
example.com. AAAA 2001:db8::42
www.example.com. CNAME example.com.
example.com. MX 10 mail.example.com.
example.com. TXT "a piece of text"
These are illustrations with documentation addresses, not records for this site.
Five questions, five answers
A asks for an IPv4 address. AAAA asks for an IPv6 address. The four A’s are a joke about the length of IPv6 addresses, but the type has its own formal definition in RFC 3596.[2]
RFC 3596, DNS extensions to support IPv6The AAAA record definition
CNAME says one name is an alias of another. It does not directly supply an IP address. The resolver follows the target name and looks up the type it actually needs. An alias needs care: DNS rules restrict other data at the same name as a CNAME.
MX identifies mail exchangers. Its number is a preference value; a lower number is preferred. It tells mail systems where to deliver mail for a domain. It does not make a mailbox exist by itself.
TXT carries strings. Email authentication and domain verification use it heavily, but DNS treats the contents as text. The service reading that text decides what it means.
A name can have several answers. The type is part of the question.
And what about ANY?
The ANY card on this exhibit is a trap. It looks like a request for every record at a name. In practice it is no reliable inventory command. RFC 8482 allows DNS servers to give minimal responses to ANY queries, partly because large answers have been abused in amplification attacks.[3]
RFC 8482, Minimal responses for ANY queriesWhy ANY does not promise every record Ask separately for the types you need.
Why the trailing dot in the example?
A trailing dot marks a fully qualified name. In a zone file, example.com. is absolute. Without the dot, a zone-file parser may append the zone’s origin. In a browser address bar you almost never need to write it.
Records are small, typed statements. Most DNS mysteries get easier once you ask which statement you expected to receive.