DNS A Record (IPv4)
The foundation of domain name resolution to an IP address.
The DNS A (Address Record) is the most fundamental and widely used type of DNS record. It establishes the mapping between a domain name and an IPv4 address. When a user types your domain in their browser, it is the A record that tells the browser which IP address to direct the request to.
Without a properly configured A record, your website would be inaccessible via its domain name. Users would need to know your server's IP address to access it - which is impractical. The A record is literally the gateway to your online presence.
Monitoring your A records is crucial for detecting unauthorized changes (DNS hijacking), configuration errors after a migration, or DNS propagation issues. MoniTao alerts you instantly if the IP associated with your domain changes.
What is an A Record?
The A record is a DNS resource record type that maps a domain name to an IPv4 address:
- Simple format: An A record contains only the hostname and target IPv4 address. For example: example.com -> 93.184.216.34.
- Direct resolution: Unlike CNAMEs which are aliases, an A record points directly to an IP address. It is the most direct form of DNS resolution.
- Multiple records: A domain can have multiple A records pointing to different IPs (round-robin DNS). Useful for basic load balancing.
- TTL (Time To Live): Each A record has a TTL that defines how long DNS resolvers can cache this information before refreshing it.
Why A Records are Critical
The A record is at the core of your site's accessibility:
- Site accessibility: If the A record is misconfigured or missing, your site becomes inaccessible. Visitors see DNS errors or are redirected to the wrong destination.
- Security: An A record modified by an attacker can redirect all your traffic to a malicious server without your visitors noticing.
- Server migration: When changing servers or hosts, updating the A record is the key step. An error can cause prolonged unavailability.
- Performance: A TTL that is too short increases DNS queries. A TTL that is too long delays change propagation. Finding the right balance is important.
How to Configure an A Record
Here are the steps to properly configure an A record:
- Access the DNS manager: Log in to your registrar's or DNS host's control panel (OVH, Cloudflare, Gandi, etc.).
- Create the record: Add a new A type record. Enter the hostname (@ for the root domain, www for the www subdomain, etc.).
- Specify the IP address: Enter your server's IPv4 address (format: xxx.xxx.xxx.xxx). Make sure it is the correct IP of your web server.
- Set the TTL: Choose an appropriate TTL. 3600 seconds (1 hour) is a good compromise. Reduce it before a planned migration.
A Record Examples
Here are configuration and verification examples for A records:
; Configuration in a DNS zone
example.com. IN A 93.184.216.34
www.example.com. IN A 93.184.216.34
api.example.com. IN A 93.184.216.35
; Verification with dig
$ dig example.com A +short
93.184.216.34
; Verification with nslookup
$ nslookup example.com
Name: example.com
Address: 93.184.216.34
; Round-robin DNS (multiple IPs)
example.com. IN A 93.184.216.34
example.com. IN A 93.184.216.35
The standard format includes the hostname, class (IN for Internet), type (A), and IPv4 address. Use dig or nslookup to verify current resolution.
A Record Best Practices
Follow these recommendations for optimal configuration:
- Monitor continuously: Use MoniTao to monitor your critical A records. Be alerted immediately if the IP changes unexpectedly.
- Document your configurations: Maintain an up-to-date list of all your A records with expected IPs. Facilitates diagnosis and recovery after incidents.
- Prepare for migrations: Before a server migration, reduce the TTL to 300 seconds a few days in advance. Restore normal TTL after complete migration.
- Consider IPv6: Also add an AAAA record for IPv6. More and more users and networks are using IPv6.
A Record Checklist
- A record configured for root domain (@)
- A record configured for www (or CNAME to @)
- IP address verified and correct
- TTL set appropriately
- MoniTao monitoring configured for the record
- AAAA record added for IPv6
Frequently Asked Questions - A Record
What is the difference between an A and AAAA record?
The A record maps to an IPv4 address (32 bits, format xxx.xxx.xxx.xxx), while the AAAA record maps to an IPv6 address (128 bits, format xxxx:xxxx:...). Both often coexist to support all connection types.
Can I have multiple A records for the same domain?
Yes, this is round-robin DNS. DNS resolvers return IP addresses in random or sequential order, allowing basic load distribution. However, this is not true load balancing as it doesn't check server health.
How long does A record propagation take?
Propagation depends on the previous TTL and DNS caches. With a 3600-second TTL, complete propagation can take 1-24 hours. Reduce TTL before a planned change to speed up propagation.
Should I use an A record or CNAME for www?
Both work. A CNAME www pointing to @ is easier to maintain (only one IP to change). A direct A record is slightly faster (one less resolution). For most sites, the difference is negligible.
How do I know if my A record is correct?
Use dig or nslookup to verify that resolution returns the expected IP. Test from multiple geographic locations to verify propagation. MoniTao can automate this monitoring.
What happens if I delete my A record?
Your domain will no longer resolve to any IP. Visitors will see DNS errors (NXDOMAIN or SERVFAIL) until the record is restored and propagated.
Master Your A Records
The A record is the foundation of DNS resolution. Correct configuration and continuous monitoring are essential to ensure your site's accessibility. Don't neglect this crucial element of your infrastructure.
With MoniTao, monitor your A records in real-time and be alerted immediately when changes occur. Protect your domain against configuration errors and DNS hijacking attempts.
Ready to Sleep Soundly?
Start free, no credit card required.