What Is an A Record?
What an A record does
An A record is a DNS record that maps a hostname to an IPv4 address. It is the most common record type, and it answers the question of which IPv4 address belongs to a given name.
IPv4 addresses are 32-bit numbers, written as four groups of digits separated by dots, such as 192.0.2.10. A typical A record looks like www.example.com. IN A 192.0.2.10, meaning that the name www.example.com points to that address. When a browser asks for the name, the resolver returns the address, and the browser connects to the server there.
Bare domain, www and multiple A records
A domain and its www version are separate names, so each usually needs its own record. A common setup has an A record for the bare domain, example.com, and another for www.example.com, both pointing to the same server address. The bare domain is called the apex of the zone, and it cannot be given a CNAME record, which is one reason the two names are often handled separately.
A single name can also have several A records, each with a different address. Resolvers return the full set, and the client chooses which address to use. This gives a simple way to spread traffic across servers, but it is not a complete load balancing system, because answers are cached and the servers are not checked for health.
Changing and limiting A records
When a website moves to a server with a different IPv4 address, its A record must be updated. The change does not take effect everywhere at once, because resolvers keep the old address until the record's TTL expires. A shorter TTL allows faster changes, at the cost of more lookups. Hosts that run services on shared infrastructure often give a name a CNAME record instead, so the underlying address can change without editing every name. That choice is explained in A record vs CNAME record.
An A record can only hold an IPv4 address. A name that must also be reached over IPv6 needs an AAAA record as well.
Frequently asked questions
Can a domain have more than one A record?
Yes. A domain or subdomain can have several A records, each pointing to a different IPv4 address. Resolvers return all of them, and clients typically try one and move to another if it does not respond. Multiple A records can spread visitors across servers, but they are a basic tool and do not replace a proper load balancer.
What is the difference between an A record and an AAAA record?
An A record holds an IPv4 address, which is 32 bits long. An AAAA record holds an IPv6 address, which is 128 bits long. Both map a name to an address, and both can exist for the same name. Devices that support IPv6 can use the AAAA record, while devices limited to IPv4 use the A record.