What is an A Record and When Should You Use One?

An A record is a type of DNS record that maps a domain to an IP address.

When you enter a website address in your browser, the owner of that domain could use an A record to route you to a specific server at the given IP address. This is why it's called an A record because it points to an address.

For example, if testsuite.io used an A record to point to the IP address 1.2.3.4, then when your browser requests testsuite.io it would be redirected to the server with that IP address, located at 1.2.3.4.

A Records vs Other Options

An A record is simple and easy to use. You point a domain or subdomain to an IP address, and your traffic gets redirected to that address. Sometimes this is not the best record for you to use.

There are a few drawbacks with A records:

How to Learn AWS
How to Learn AWS
Learn AWS the easy way, become a leader on your team.
How to Learn AWS
LEARN MORE
  • You can't point another domain name
  • They only map to IPv4 addresses
  • If your IP is dynamic, your A record will have to change frequently

Because of these limitations, other DNS records can sometimes be a better choice.

Where an A record must point to an IP address, a CNAME or ALIAS can point to other names. This makes these options better suited when you have a dynamic IP address or when you don't have control over when your IP address changes.

Featured
Level up faster
Hey, I'm Nick Dill.

I help people become better software developers with daily tips, tricks, and advice.