An A record links a domain name to an IPv4 address. For example, it is the answer from this record that lets the browser reach the right server to visit a website. For IPv6 use an AAAA record. A PTR record does the reverse and maps an IPv4 address to a name.
An A record has a name, a type, a value and a TTL. TTL tells how long the answer stays cached in the local resolver.
| Name | Type | IPv4 address | TTL in seconds |
|---|
| www | A | 203.0.113.10 | 3600 |
In this example the name www is a subdomain. To target the domain apex use the at sign. The value must be a valid IPv4 address that is reachable on the Internet. TTL 3600 equals one hour.
Publishing several A records for one name is possible. The local resolver receives a list and picks one. This simple rotation spreads a load across servers.
| Name | Type | IPv4 address | TTL in seconds |
|---|
| www | A | 203.0.113.10 | 3600 |
| www | A | 203.0.113.11 | 3600 |
This rotation does not replace real automatic failover. If one address is down some visitors can still receive it for a short time.
TTL (time to live) is the number of seconds a resolver keeps an answer in its cache before asking the authoritative servers again. While the timer runs every visitor receives the cached IPv4 address, so changes only appear after the countdown reaches zero.
A short TTL such as 60 or 300 seconds lets you adjust records quickly, but it increases the query load on your authoritative servers and can make outages more noticeable. A longer TTL such as 3600 seconds or more reduces traffic and keeps responses stable, yet it delays the effect of any update.
Before a planned migration lower the TTL at least a few hours in advance—ideally the previous day—so caches refresh with the shorter value. Perform the change once the old TTL has expired everywhere, monitor the switch, and raise the TTL again when the new setup is stable.
Good to know
Some resolvers ignore sudden TTL drops if they cached the old longer value. Plan ahead so caches have time to expire naturally before you rely on the shorter timer.
At the domain apex publish A records. Setting a CNAME there is not compliant.
For www you can use an A record when you control the IP address. Otherwise, choose a CNAME when pointing to another name managed by a provider.
For other subdomains like api cdn blog, you can use CNAME A or AAAA records. Each service can keep its own address. Changes then stay simple.
Avoid
Mixing A and CNAME on the same name which is not RFC compliant.
Publishing a private address in a public zone.
Leaving an old A record after a migration.
An online DNS lookup lets you enter a domain name. You get the list of IPv4 addresses for the A record and the TTL visible from the Internet. It is a useful first check. Then run a local test from your machine.
Windows provides nslookup. You can use it in interactive mode.
nslookup
set q=a
www.example.com
nslookup
set q=a
server 1.1.1.1
www.example.com
The first part queries an A record using the machine's network settings. The second part forces a third party resolver here Cloudflare.
On these systems the dig command is handy and easy to use.
dig a www.example.com
dig a www.example.com @1.1.1.1
Several IPv4 addresses mean simple traffic spreading.
A high remaining TTL can explain a delay after a change.
An empty answer or a resolution failure often points to a bad entry or an address removed too early.
- Prepare the new server with its new address.
- Lower TTL to 300 or even 60 seconds on the name a few hours before the switch.
- Replace the old address with the new one at the planned time.
- Check with
nslookup or the dig command from several networks. - Raise TTL to a comfortable value when everything is stable.
Practical tip
Keep a tracking sheet for each name. Note the owner the date the chosen TTL and the reason for the change. This trace prevents misses and speeds a rollback if needed.
Use CNAME for www to follow provider changes and keep an A record on the root domain.
Publish several addresses close to visitors. The local resolver picks one IPv4 address from the list. For precise location-based routing you need advanced DNS features or an application network.
The A record publishes the IPv4 address of the mail server. The reverse PTR helps deliverability. Both should match. Updates do not sync in both directions by themselves.
- If the site does not respond check local resolution first.
- If the answer shows a private address fix the public zone.
- If answers rotate between two addresses and one is offline remove the failing address.
- If the answer stays old after an update wait for TTL to expire and clear the local resolver cache if possible.
To summarize, an A record maps a name to an IPv4 address. TTL controls cache time in the local resolver. Several addresses can spread traffic but do not create failover. CNAME does not live with an A record on the same name. The apex publishes A records. Verification starts with an online tool, then with nslookup on Windows and with dig on Linux and on Mac.
With these basics management stays simple. Changes happen without stress. Visitors reach the site without issues.