Kahibaro
Discord Login Register

12.4.1 A

Understanding the A Record

The A record is the simplest and most common type of DNS record. It is the basic building block that connects human friendly domain names to machine friendly IPv4 addresses.

Purpose of an A Record

An A record stores the IPv4 address for a hostname. When you type a domain like example.com into a browser, the DNS system uses an A record to find the corresponding IPv4 address, such as 93.184.216.34. Your device then connects to that address at the appropriate port and protocol.

The A in A record stands for "Address." It always represents an IPv4 address, never IPv6. IPv6 addresses are handled by a different record type, which is covered separately.

Structure of an A Record

An A record contains several fields, though how they are displayed can vary between DNS servers and management interfaces. Conceptually, the important parts are the same.

A typical A record includes:

FieldDescriptionExample
NameHostname being mappedwww.example.com
TypeDNS record typeA
TTLTime To Live in seconds3600
ClassUsually InternetIN
ValueIPv4 address for the hostname93.184.216.34

In a zone file like syntax, it might look like this:

www 3600 IN A 93.184.216.34

This means: the host www in this zone has an IPv4 address of 93.184.216.34, and this answer can be cached for up to 3600 seconds.

Hostnames, Root, and Subdomains

An A record can be created for different hostnames within the same domain.

Common examples:

HostnameMeaningTypical Use
example.comThe root or apex of the domainMain website
www.example.comA common web host nameWeb site access
api.example.comA subdomain for an application programming APIAPI servers
mail.example.comA host for mail servicesMail transfer or access

In many DNS control panels, the root name is entered as @ to represent the domain itself. So an A record with name @ and value 93.184.216.34 maps example.com to that IP address.

Multiple A Records for One Name

The same hostname can have more than one A record. This is often used for simple load distribution and redundancy. When multiple A records exist for one name, each with a different IP address, recursive resolvers typically return all of them. Clients can then choose one of the returned addresses.

Example:

NameTypeValue
www.example.comA203.0.113.10
www.example.comA203.0.113.11
www.example.comA203.0.113.12

Browsers usually try one IP address, and if that fails, may try another. This pattern allows you to run the same service on multiple servers and let clients spread out their connections.

TTL and Caching Behavior

The TTL of an A record controls how long DNS resolvers and clients are allowed to cache the mapping from hostname to IP address.

A low TTL means changes propagate more quickly, but resolvers need to query more often, which increases DNS traffic. A higher TTL gives more stable caching but makes changes slower to take effect.

The TTL is a limit, not a guarantee. A resolver may cache an A record for up to its TTL in seconds, and will normally not ask again before it expires.

When planning changes, administrators often temporarily lower TTL values ahead of time so that updated A records are picked up more quickly.

A Records and the DNS Hierarchy

A records live at the bottom of the DNS lookup process, after name resolution has followed the domain hierarchy. Higher level servers are responsible for delegating queries to the authoritative servers for a domain. The authoritative servers for that domain then provide the actual A records.

From the perspective of an A record, the important part is that it is stored on the authoritative name server for the domain and that this server returns the A record in response to queries about that hostname.

A Records vs Other Record Types

An A record directly maps a hostname to an IPv4 address. It does not redirect to another name. If you want a hostname to point to another hostname instead of an IP address, a different record type is used and described elsewhere in this course.

The A record is also different from records that describe services or additional metadata, which are covered in other sections.

Common Practical Uses

Administrators use A records to connect public names to server IPs. Some typical uses include mapping:

The main website name to the web server IP.

A subdomain like blog.example.com to a different server IP that hosts a blog platform.

A game server name to the IP address of the game host.

A short, easy to remember name in a private network to an internal server IP.

Whenever you need a hostname to resolve to an IPv4 address, an A record is the primary tool.

Views: 39

Comments

Please login to add a comment.

Don't have an account? Register now!