What Is an A Record
Learn what an A record is and how it connects your domain name to the correct IPv4 address. Includes examples for the DNScale dashboard and API.
An A (Address) record is the most fundamental DNS record type. It maps a domain name to an IPv4 address, allowing users to access your website using an easy-to-remember name instead of a numeric IP address.
How A Records Work
When someone types your domain into a browser:
- The browser asks a DNS resolver for the A record
- The resolver returns the IPv4 address from the A record
- The browser connects to that IP address to load your site
example.com. 3600 IN A 192.0.2.1This record tells DNS resolvers that example.com points to 192.0.2.1 with a TTL of 3600 seconds (1 hour).
Common Use Cases
Single Server Hosting
Point your domain to a web server:
example.com. 3600 A 192.0.2.1
www.example.com. 3600 A 192.0.2.1Load Balancing with Multiple A Records
Distribute traffic across multiple servers using round-robin DNS:
example.com. 300 A 192.0.2.1
example.com. 300 A 192.0.2.2
example.com. 300 A 192.0.2.3Subdomains for Different Services
api.example.com. 3600 A 192.0.2.10
mail.example.com. 3600 A 192.0.2.20
staging.example.com. 3600 A 192.0.2.30Record Format
| Field | Description | Example |
|---|---|---|
| Name | Domain or subdomain | www, @ (apex), api |
| Type | Record type | A |
| Content | IPv4 address | 192.0.2.1 |
| TTL | Time to live (seconds) | 3600 |
Adding an A Record
Using the Dashboard
- Navigate to your zone in the DNScale dashboard
- Click Add Record
- Configure the record:
- Name: Enter subdomain (e.g.,
www) or@for apex - Type: Select
A - Value: Enter the IPv4 address
- TTL: Set the cache duration (default: 3600)
- Name: Enter subdomain (e.g.,
- Click Create Record
Using the API
Create an A record:
curl -X POST "https://api.dnscale.eu/v1/zones/{zone_id}/records" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "www",
"type": "A",
"content": "192.0.2.1",
"ttl": 3600
}'Create multiple A records for load balancing:
# First server
curl -X POST "https://api.dnscale.eu/v1/zones/{zone_id}/records" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "@",
"type": "A",
"content": "192.0.2.1",
"ttl": 300
}'
# Second server
curl -X POST "https://api.dnscale.eu/v1/zones/{zone_id}/records" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "@",
"type": "A",
"content": "192.0.2.2",
"ttl": 300
}'API Response:
{
"status": "success",
"data": {
"message": "Record created successfully",
"record": {
"id": "encoded-record-id",
"name": "www.example.com.",
"type": "A",
"content": "192.0.2.1",
"ttl": 3600,
"disabled": false
}
}
}Best Practices
-
Use appropriate TTL values
- Short TTL (300-900s) if you expect to change the IP frequently
- Longer TTL (3600-86400s) for stable servers to improve caching
-
Add both A and AAAA records - Support both IPv4 and IPv6 for better connectivity
-
Consider redundancy - Use multiple A records for high-availability setups
-
Apex domain records - Use
@or leave name empty for the root domain
Related Record Types
- AAAA - IPv6 equivalent of A records
- CNAME - Alias to another domain name
- ALIAS - Root domain aliasing
Conclusion
A records are the foundation of DNS, enabling the internet's domain name to IP address translation. With DNScale, managing A records is straightforward whether you're hosting a single website or building a load-balanced infrastructure.