How to Set Up an A Record for Your Server
The A record is the single most important DNS record for pointing a domain at a server. Here's exactly what it does, how to add one, and how to test it.

An A record maps a hostname to an IPv4 address — it's the record that makes example.com resolve to 203.0.113.10 so browsers know which server to contact. If you're pointing any domain at any server, this is the record you need. This guide is registrar-agnostic: the fields are the same everywhere.
What an A record actually is
DNS is the internet's address book, and the A record is the core entry: name → IPv4 address. When someone types your domain, their resolver looks up the A record and gets an IP to connect to. For the bigger picture, how DNS works and DNS records explained give the full tour.
An A record has three parts you set:
- Name (Host): which hostname this applies to —
@for the root,www,api, etc. - Value: the IPv4 address, e.g.
203.0.113.10 - TTL: how long resolvers cache it, in seconds
Step 1: Find your server's IP
On the server:
curl -4 ifconfig.co
or check your host's control panel. You want the public IPv4, not a private 10.x / 192.168.x address. IPv6 uses an AAAA record instead — same idea, different type.
Step 2: Add the record
In your DNS provider's panel, create a record:
- Type: A
- Name:
@(root) — or a subdomain label - Value:
203.0.113.10 - TTL: 3600 (one hour) is a fine default
For the bare domain, most panels use @; some want the domain typed in full or left blank. Add a second A record for www, or point www at the root with a CNAME — see how to set up a CNAME record.

Step 3: Pick a sensible TTL
TTL controls caching. A long TTL (86400 = one day) reduces lookups but means changes take a day to take effect. A short TTL (300 = five minutes) makes changes fast but slightly busier. The practical rule: keep it at 3600 normally, and drop it to 300 a day *before* you plan to change the IP, so the switch is quick. Deep dive: TTL in DNS explained and DNS propagation explained.
Step 4: Verify
dig +short example.com A
You should get exactly your server IP back. To see the TTL and the authoritative answer:
dig example.com A +noall +answer
If nothing comes back, the record didn't save, you edited the wrong zone, or propagation is still in progress. The full toolkit is in diagnosing DNS problems with dig and nslookup.
Multiple A records and round-robin
You can add several A records with the same name pointing at different IPs; resolvers hand them out in rotation (round-robin), a crude form of load balancing. For most single-VPS setups you want exactly one A record per hostname.
A records vs AAAA records (IPv4 vs IPv6)
An A record holds an IPv4 address like 203.0.113.10. If your server also has IPv6 — most modern VPSes do — add a matching AAAA record with the 2001:... address for the same hostname:
example.com. A 203.0.113.10
example.com. AAAA 2001:db8:1234::10
Clients on IPv6 networks will prefer the AAAA; everyone else uses the A. The two coexist happily. If you publish an AAAA record, make sure the service actually listens on IPv6, or IPv6 visitors will time out while IPv4 visitors are fine — a confusing "works for some people" bug.
Add A records for subdomains
Subdomains are just A records with a label instead of @:
- Name:
api→api.example.com - Name:
blog→blog.example.com - Name:
*→ wildcard, matching any subdomain
You can point them at the same server as the root or a completely different IP. To route several subdomains to different apps on one box, DNS gets them to the server and a reverse proxy splits them by port — see how to point a subdomain to a different app or port.
Change a server IP without downtime
When you migrate to a new server, the A record is what you switch. Do it cleanly:
- A day ahead, lower the record's TTL to 300 (5 minutes) so the change propagates fast.
- Stand up the new server and confirm it works via its raw IP.
- Update the A record to the new IP.
- Keep the old server running for the length of the *old* TTL, since some resolvers still have the old value cached.
- Once traffic has fully moved (watch the logs), decommission the old box and raise the TTL back to 3600.
This overlap is why lowering TTL in advance matters — see DNS propagation explained. If you're moving a whole site, how to point a domain to your VPS covers the wider migration.
FAQ
What's the difference between an A record and a CNAME?
An A record points a name straight at an IP address. A CNAME points a name at *another name*, which is then resolved to an IP. Use A for the root domain and where you know the IP; use CNAME to alias one hostname to another.
Can the root domain use a CNAME instead of an A record?
Traditionally no — the apex (@) needs an A record. Some providers offer CNAME flattening / ALIAS records to work around this, but a plain A record is the safe choice.
Why does my A record change take so long?
Resolvers cache the old value for the length of the previous TTL. If the old TTL was a day, some users see the old IP for up to a day.
How many A records can I have?
As many hostnames as you like, and multiple per hostname for round-robin. There's no practical limit for a normal site.
Should I add both an A and an AAAA record?
Add an AAAA record only if your server actually has and listens on IPv6. When it does, publishing both an A (IPv4) and an AAAA (IPv6) record is best practice — IPv6-capable clients use the AAAA, everyone else uses the A, and the two never conflict. The danger is publishing an AAAA for an address your service doesn't answer on: IPv6 users then hit a dead endpoint and time out while IPv4 users work fine, producing a baffling "broken for some people" report. So verify the server responds on its IPv6 address first (curl -6 from another host), and only then publish the AAAA. If you're IPv4-only, a single A record is entirely correct.
Got the IP of a real server to point at? Launch a fast NVMe VPS with full root access from Nxeon, and register your domain through Nxeon domains to keep DNS and hosting together.