How to Point a Domain to an IP

Pointing a domain to an IP address is the most common DNS task there is, and it comes down to a single A record. This guide shows how to create that record, how to handle IPv6 and the www subdomain, how to choose a TTL, and how to confirm your domain now resolves to the right server.

Use an A record

To point a domain at a server, you create an A record that maps the name to the server's IPv4 address. An A record has a host (the name, such as the apex or a subdomain) and a value (the IP address it resolves to).

If your server has an IPv6 address as well, add an AAAA record with the same host pointing to the IPv6 address. Having both means visitors on either protocol reach the same server.

Step by step in your DNS provider

The exact labels vary between providers, but the flow is the same everywhere:

  1. Open the DNS management area for your domain at your DNS provider.
  2. Add a new record and choose the type A (or AAAA for an IPv6 address).
  3. Set the host or name. Leave it blank or use the apex marker your provider offers for the root domain, or enter a subdomain such as app.
  4. Set the value to your IP address, for example 203.0.113.10.
  5. Choose a TTL and save the record.

Apex versus www

The apex domain, such as example.com with no subdomain, must point to an IP using an A or AAAA record. It cannot use a CNAME record, because that conflicts with other records at the apex.

For the www subdomain you have two options. Add a CNAME for www that points to the apex so it always follows wherever the apex resolves, or add a second A record for www with the same IP. The CNAME approach is usually cleaner, since you only ever update the IP in one place. Some providers also offer an ALIAS or ANAME record to get CNAME-like behaviour at the apex itself.

TTL considerations

The TTL tells resolvers how long to cache the record. A long TTL such as 3600 seconds reduces lookups but means a future change takes longer to take effect. If you expect to move servers soon, lower the TTL to 300 seconds a day or two ahead of time so the switch propagates quickly, then raise it again once you are settled.

Verify

Confirm the record is live by querying it:

dig +short example.com A

When the answer is your server's IP, the record is working for that resolver. If you just created or changed it, allow time for the old value to expire elsewhere. To confirm it is live worldwide, follow our guide on how to check DNS propagation.

Never miss a DNS change again.
Start monitoring in minutes.