DNS A Record
Address RecordWhat is a A Record?
A DNS A record (Address record) is the most fundamental type of DNS record. It maps a domain name directly to an IPv4 address, enabling web browsers and other internet clients to locate the server hosting a website or service. When you type a domain name like example.com into your browser, the DNS resolver queries for the A record to find the corresponding IP address.
A records are essential for virtually every domain on the internet. Without an A record, a domain cannot be resolved to an IPv4 address, meaning users cannot reach the website or service associated with that domain. A single domain can have multiple A records pointing to different IP addresses for load balancing and redundancy, a technique known as DNS round-robin.
A records only handle IPv4 addresses (32-bit addresses in dotted-decimal notation like 192.0.2.1). For IPv6 addresses, the equivalent record type is AAAA. Most modern domains maintain both A and AAAA records to support both IPv4 and IPv6 connectivity.
Syntax & Examples
The syntax of a DNS A record follows the standard DNS resource record format:
example.com. 3600 IN A 192.0.2.1
Here, 'example.com.' is the domain name (with trailing dot indicating FQDN), '3600' is the TTL (Time to Live) in seconds, 'IN' is the class (Internet), 'A' is the record type, and '192.0.2.1' is the IPv4 address. You can define multiple A records for the same domain to point to different servers:
example.com. 3600 IN A 192.0.2.1
example.com. 3600 IN A 192.0.2.2
How to Query A Records
To query A records using the dig command, run: dig example.com A or simply dig example.com (A is the default query type). The output will show the ANSWER SECTION containing the domain's A records. You can add +short for concise output: dig +short example.com A. To query a specific DNS server, use: dig @8.8.8.8 example.com A.
Using nslookup, run: nslookup example.com or nslookup -type=A example.com. On Windows, you can also use: nslookup -querytype=A example.com. For PowerShell users, the Resolve-DnsName cmdlet works well: Resolve-DnsName -Name example.com -Type A. All these tools will return the IPv4 addresses associated with the queried domain.
Related Record Types
Frequently Asked Questions
What is a DNS A record?
A DNS A record (Address record) maps a domain name to an IPv4 address. It is the most common DNS record type and is essential for directing web traffic to the correct server. When a browser resolves a domain, it typically looks up the A record first.
Can I have multiple A records for one domain?
Yes, you can configure multiple A records for the same domain, each pointing to a different IPv4 address. This is commonly used for load balancing (DNS round-robin), where traffic is distributed across multiple servers, and for redundancy in case one server becomes unavailable.
What is the difference between an A record and a CNAME record?
An A record maps a domain directly to an IPv4 address, while a CNAME record maps a domain to another domain name (an alias). CNAME records require an additional DNS lookup to resolve the final IP address, while A records provide the address directly. A CNAME cannot coexist with other record types at the same name.
How long does it take for A record changes to propagate?
DNS propagation time depends on the TTL (Time to Live) value set on the record. A typical TTL of 3600 seconds (1 hour) means changes may take up to 1 hour to propagate globally. Before making changes, you can lower the TTL in advance to speed up propagation, then raise it again afterward.
What happens if a domain has no A record?
If a domain has no A record, it cannot be resolved to an IPv4 address. Browsers and other clients attempting to connect via IPv4 will receive a DNS resolution error (NXDOMAIN or NOERROR with no answer). The domain may still work over IPv6 if an AAAA record exists, or via a CNAME that ultimately resolves to an A record.