A record: what it is and how to check it
Points a domain or subdomain to an IPv4 address. The most basic record on the internet.
What it is
An A record (address record) connects a name, such as example.com or www.example.com, to an IPv4 address, such as 192.0.2.10. When you type a website address into a browser, the browser asks the Domain Name System (DNS) for the A record of that name, then connects to the address it gets back.
The A record is defined in RFC 1035, one of the two original DNS specifications. It is the oldest and still the most common record type. Its IPv6 counterpart is the AAAA record.
How it works
Every DNS record lives in a zone, which is the set of records your DNS provider publishes for your domain. When a device needs the address of www.example.com:
- It asks a recursive resolver, usually run by your internet provider or a public service such as Cloudflare 1.1.1.1, Google Public DNS or Quad9.
- If the resolver does not have the answer in cache, it follows the chain of delegations: from the root servers to the
.comservers, then to the authoritative nameservers forexample.comlisted in its NS records. - The authoritative server answers with the A record, for example
192.0.2.10, together with a TTL (time to live) in seconds. - The resolver passes the answer back and keeps it in cache for up to the TTL, so the next visitor gets it instantly.
If the name exists but has no A record, the answer is empty with status NOERROR (often called “NODATA”). If the name does not exist at all, the status is NXDOMAIN.
A name can have several A records. The resolver returns them all, often in a rotating order, and the client picks one. This is called round-robin DNS.
Syntax and fields
In zone-file format an A record has five parts:
| Field | Example | Meaning |
|---|---|---|
| Name | www.example.com. |
The name being described. A trailing dot means a fully qualified name; @ means the zone apex (the bare domain). |
| TTL | 3600 |
How many seconds resolvers may cache the answer. |
| Class | IN |
Always IN (internet) in practice. |
| Type | A |
The record type. |
| Data | 192.0.2.10 |
One IPv4 address in dotted decimal notation. |
The data is always exactly one IPv4 address: 32 bits, written as four numbers from 0 to 255. You cannot put a host name, a port number or a URL in an A record.
Examples
A website on a single server, reachable both with and without www:
example.com. 3600 IN A 192.0.2.10
www.example.com. 3600 IN A 192.0.2.10
Two servers sharing traffic with round-robin DNS:
app.example.com. 300 IN A 198.51.100.21
app.example.com. 300 IN A 198.51.100.22
A wildcard that answers for any undefined subdomain (RFC 4592):
*.example.com. 3600 IN A 203.0.113.5
A wildcard only applies to names that do not exist in the zone. If shop.example.com has any record of its own, for example a TXT record, the wildcard does not supply an A record for it.
Common mistakes
- Leaving an old address behind. If you move to a new host, delete the old A record. Two A records pointing to two different servers make visitors land on either one at random.
- Forgetting the apex or
www.example.comandwww.example.comare different names. Each needs its own record (orwwwcan be a CNAME to the apex). - Adding a CNAME on the same name. A name with a CNAME cannot have an A record, and vice versa. Most DNS panels refuse the combination, but some silently keep only one of them.
- Using a private address on a public name. Addresses such as
10.0.0.5or192.168.1.10only work inside a local network. Publishing them in public DNS makes the site unreachable from outside and reveals details of your internal network. - Changing the record with a long TTL. If the TTL is 86400 (one day), some visitors will keep reaching the old server for up to a day. Lower the TTL to 300 a day or so before a planned move, then raise it again afterwards.
- Expecting an A record to redirect. DNS only returns an address. Redirecting
example.comtohttps://www.example.com/is done by the web server, not by DNS.
How to check it
Use the DNS lookup tool and choose type A. It shows every A record for the name, the TTL left in cache, the response status and a dig-style text view you can copy. You can switch between Cloudflare, Google Public DNS and Quad9 to compare their caches.
After a change, the DNS propagation checker queries the three public resolvers and the domain’s authoritative nameservers side by side. The authoritative answer is what you have actually published; the resolvers show what visitors may still see from cache.
To find who operates an address, use the IP lookup, which also shows the reverse DNS name.
Related records
- AAAA: the same job for IPv6 addresses.
- CNAME: makes one name an alias of another instead of pointing to an address.
- PTR: the reverse mapping, from an IP address back to a name.
- NS: tells resolvers which servers hold your A records.
- HTTPS / SVCB: can give browsers address hints and protocol information in one lookup.
Frequently asked questions
Can a domain have more than one A record?
Yes. A name can have several A records with different IPv4 addresses. Resolvers return all of them and clients usually try them in turn, which gives a simple form of load distribution and redundancy. It is not real load balancing: there is no health checking, so a dead server stays in the list until you remove it.
Can I put an A record and a CNAME on the same name?
No. A CNAME cannot coexist with any other record on the same name (RFC 1034, section 3.6.2). If you need an alias, use the CNAME alone; if you need other records on that name, use A and AAAA records instead.
How long does a new A record take to work?
A brand new record is usually visible within a minute or two once your DNS provider publishes it. A changed record takes up to the old TTL to reach everyone, because resolvers keep the previous answer in cache until it expires.
Does the A record affect my email?
Only indirectly. Mail is routed by MX records, but each MX target must itself have an A or AAAA record. Changing the A record of your website does not move your email unless your MX record points to that same name.