The DNS A record is the most fundamental record in the Domain Name System. It creates a direct mapping between a human-readable domain name and an IPv4 address, allowing browsers, mail servers, and other internet services to locate the correct server when someone types your domain name into their address bar.
What Is a DNS A Record?
An A record (short for Address record) tells DNS resolvers which IPv4 address a domain name points to. When you visit example.com, your browser asks the DNS system for the A record associated with that domain. The resolver returns an IP address such as 93.184.216.34, and your browser then opens a TCP connection to that address.
Without an A record, a domain name has no destination. Every website that serves traffic over IPv4 must have at least one A record configured in its DNS zone. A records are stored on the authoritative nameservers for your domain and are served to any resolver that queries them.
A Record Syntax
A records follow the standard DNS zone file format. Each field is separated by whitespace and the record ends when the line ends. Here is the standard structure:
; A record syntax
; NAME TTL CLASS TYPE RDATA (IPv4 address)
example.com. 3600 IN A 93.184.216.34
www.example.com. 3600 IN A 93.184.216.34The fields are:
- NAME — the domain or subdomain the record applies to. A trailing dot represents the DNS root and is standard in zone files.
- TTL — Time to Live in seconds. Controls how long resolvers cache this record before re-querying.
- CLASS — always
IN(Internet) for standard DNS records. - TYPE —
Afor this record type. - RDATA — the IPv4 address in dotted-decimal notation (e.g.,
192.0.2.1).
Root Domain vs. Subdomain A Records
A records are used at two common levels: the root (apex) domain and subdomains. Both are configured the same way — the only difference is the name field.
; Root domain (apex) — points example.com to a server
example.com. 3600 IN A 203.0.113.10
; www subdomain — points www.example.com to the same or different server
www.example.com. 3600 IN A 203.0.113.10
; blog subdomain pointing to a separate server
blog.example.com. 3600 IN A 198.51.100.5Unlike CNAME records, A records can be placed at the root domain. In fact, a root-level A record is required any time you want example.com (without www) to resolve to a server. Many DNS providers also allow you to use CNAME-like flattening at the root, but under the hood, they still publish an A record.
Multiple A Records and DNS Load Balancing
You can publish more than one A record for the same name. When multiple A records exist, DNS resolvers return all of them, and clients typically try each in turn or use round-robin selection. This is a simple form of load balancing and improves availability.
; Multiple A records for simple round-robin load balancing
example.com. 60 IN A 203.0.113.10
example.com. 60 IN A 203.0.113.11
example.com. 60 IN A 203.0.113.12Understanding TTL in A Records
TTL (Time to Live) determines how long resolvers and browsers cache your A record before fetching a fresh copy. A TTL of 3600 means the record is cached for one hour. A TTL of 86400means 24 hours.
Choosing the right TTL involves a trade-off:
- High TTL (86400+) — reduces DNS query load and speeds up lookups for returning visitors, but makes IP changes slow to propagate.
- Low TTL (300 or less) — changes propagate faster, useful before a migration, but increases query volume and slightly slows first-time lookups.
A common practice is to reduce TTL to 300 seconds 24–48 hours before a planned migration, perform the change, then restore a higher TTL once the new record has propagated globally.
When Should You Use an A Record?
Use an A record whenever you need to map a domain name directly to a specific IPv4 address. Common scenarios include:
- Pointing your root domain (
example.com) to a web server or load balancer. - Pointing subdomains (
mail.example.com,ftp.example.com) to specific servers. - Setting up custom hostnames for VPNs, internal tools, or staging environments.
- Configuring game servers, voice servers, or any TCP/UDP service with a fixed IP address.
www to your CDN provider's hostname), you should use a CNAME record instead of an A record. CNAME records track wherever that hostname points, so you don't need to update your DNS when the CDN changes its IP addresses.How to Look Up an A Record
You can check any domain's A record using ShowDNS DNS Lookup. Enter the domain name, select the A record type, and the tool will query authoritative nameservers and return the current value along with the TTL.
From the command line, you can also use dig or nslookup:
; Using dig to query an A record
dig example.com A
; Expected output (abbreviated)
;; ANSWER SECTION:
example.com. 3600 IN A 93.184.216.34Frequently Asked Questions
What is the difference between an A record and a CNAME record?
An A record maps a name directly to an IPv4 address. A CNAME record maps a name to another domain name (an alias), and the resolver then looks up the A record for that target. A records are faster because they require one fewer lookup, and they are the only option at the root domain. CNAMEs are more flexible because they automatically follow IP changes at the target hostname.
Can I have multiple A records for the same domain?
Yes. You can publish as many A records as you need for the same domain name. DNS resolvers will return all of them, and clients will attempt each address in order or use them for round-robin load distribution. This is commonly used for basic load balancing and high-availability setups.
What happens if an A record is missing?
If a domain has no A record (and no other mechanism to resolve it, such as an ALIAS or ANAME record), DNS resolvers will return an NXDOMAIN or NOERROR/NODATA response, and browsers will display a "DNS_PROBE_FINISHED_NXDOMAIN" or similar error. The site will be unreachable until a valid A record is published.
How long does it take for an A record change to propagate?
Propagation time depends on the TTL of the old record. Once the old TTL expires, resolvers discard their cached copy and fetch the new value. If the previous TTL was 86400 (24 hours), full propagation could take up to 24 hours. If you lowered the TTL to 300 seconds before making the change, propagation completes within 5 minutes for most resolvers.
Can an A record point to a private IP address?
Technically yes — a DNS A record can point to any IPv4 address, including private ranges like10.0.0.0/8 or 192.168.0.0/16. This is common in internal (split-horizon) DNS setups where internal users resolve a hostname to a private address while external users get the public IP. However, if the record is public and points to a private address, external users will not be able to reach the server.