A Record vs AAAA Record in DNS

An A record contains one IPv4 address for a hostname, while an AAAA record contains one IPv6 address. A hostname can have either type, both types or neither. Asking DNS for one type does not automatically return the other.
An address returned by DNS does not prove that a server is listening there, that the network can route to it or that a website will load. The examples below use addresses reserved for documentation. A production record needs an address assigned to the actual service.
Two Address Families, Two Record Types
IPv4 addresses are usually written as four decimal numbers separated by dots, such as 192.0.2.10, and an A record stores the address as a 32-bit value. IPv6 addresses use colon-separated hexadecimal notation, such as 2001:db8::10, and an AAAA record stores a 128-bit value. Each record contains one address for one owner name. The record type tells a client how to interpret the address data.
The hostname is the owner name of the record. For www.example.com, an A query asks for that name's IPv4 address records, and an AAAA query asks for its IPv6 address records. The Internet class, commonly shown as IN, identifies the DNS class. A tool might also show a TTL, the number of seconds for which the answer may normally be cached.
An AAAA record is sometimes called a quad-A record, but it is not four A records joined together. It is a distinct DNS type defined for IPv6. An A field accepts an IPv4 address, whereas an AAAA field requires an IPv6 address. Swapping those values does not convert an address between families.
Read Example A and AAAA Answers
Imagine a DNS tool displaying www.example.com. 300 IN A 192.0.2.10. The owner name is www.example.com., the TTL shown is 300 seconds, the class is IN, the type is A and the data after the type is an IPv4 address. A separate query might display www.example.com. 300 IN AAAA 2001:db8::10. That answer associates the same hostname with an IPv6 address.
The two answers can coexist without conflict because A and AAAA form separate record sets. Their TTLs can differ, and either set can change without the other changing. A client with only IPv4 connectivity can use the A answer; a client with usable IPv6 can also consider the AAAA answer. The returned addresses are connection candidates, and the client and network determine whether a connection succeeds.
A successful response with no A data can coexist with an AAAA response containing an address, or vice versa. NODATA means the requested record type is absent. NXDOMAIN reports a nonexistent name, which can be the target at the end of a CNAME chain. A timeout or SERVFAIL is a failed lookup, so it does not establish that an address record is absent. Query both types and check the response status before concluding that a hostname has no addresses.
If the answer contains a CNAME alias, the requested name points to another DNS name instead of directly carrying address records at that alias owner. Follow the target and inspect its A and AAAA answers. The alias step does not change the meaning of the final address types.
Multiple Addresses Are Normal
A name can have more than one A record, more than one AAAA record or several of each. Records with the same name, class and type form a resource record set, or RRset. A complete answer includes all members of the relevant set. Several records with different addresses are not duplicate errors.
For example, two A addresses may correspond to two service endpoints, while two AAAA addresses may serve the IPv6 side. The DNS record format does not say that the first address shown is always preferred or that the second is a backup. A resolver may present an order, and client software can choose addresses according to its own algorithms and network conditions. Do not infer a guaranteed load-balancing or failover policy from the presence of multiple addresses alone.
When checking a change, compare the complete A RRset and the complete AAAA RRset returned by the authoritative nameserver with the sets returned by the resolver in use. A resolver can cache the two record sets independently, so it may return an outdated A answer alongside a current AAAA answer. When updating a dual-stack service, check both address families and publish only addresses at which the service is reachable.
A Published Address Is Not a Reachability Test
An AAAA answer supplies an IPv6 address without proving that end-to-end IPv6 works. The client needs usable IPv6 connectivity, routing to the destination and a service listening at the expected port. Firewalls, wrong addresses and server configuration can cause a connection to fail despite a correct DNS answer. The same caveat applies to an A record and IPv4.
DNS query transport is independent of the address family in the answer. An IPv4 connection to a DNS server can carry an AAAA query, and an IPv6 connection can carry an A query. A successful AAAA lookup over IPv4 therefore does not test the IPv6 path to the returned destination. To diagnose a connection problem, first establish the DNS answer, then test the network path and application separately.
If only some users cannot reach a service, note which address family their clients tried, the exact address returned and whether the server is configured to accept connections at that address. A browser error may occur after the lookup succeeds. If both A and AAAA answers are correct but one family is unreachable, changing the DNS resolver is unlikely to repair routing or a stopped service.







