ifferences Among A, CNAME, ALIAS, and URL records
https://support.dnsimple.com/articles/differences-between-a-cname-alias-url/
A, CNAME, ALIAS, and URL records are all possible solutions to point a host name (“name”) to your site. However, they have small differences that affect how the client reaches your site.
A and CNAME records are standard DNS records. ALIAS and URL records are custom DNS records provided by DNSimple’s DNS hosting. Both of them are translated internally into A records to ensure compatibility with the DNS protocol.
Understanding the differences
These are the main differences:
- The
Arecord maps a name to one or more IP addresses when the IP are known and stable. - The
CNAMErecord maps a name to another name. It should only be used when there are no other records on that name. - The
ALIASrecord maps a name to another name, but can coexist with other records on that name. - The
URLrecord redirects the name to the target name using the HTTP 301 status code.
Important rules:
- The
A,CNAME, andALIASrecords cause a name to resolve to an IP. Conversely, theURLrecord redirects the name to a destination. TheURLrecord is a simple and effective way to apply a redirect for one name to another name, for example redirectingwww.example.comtoexample.com. - The
Aname must resolve to an IP. TheCNAMEandALIASrecords must point to a name.
Which one to use
Understanding the difference between A name and CNAME records will help you decide.
General rules:
- Use an
Arecord if you manage which IP addresses are assigned to a particular machine, or if the IP are fixed (this is the most common case). - Use a
CNAMErecord if you want to alias one name to another name, and you don’t need other records (such asMXrecords for emails) for the same name. - Use an
ALIASrecord if you’re trying to alias the root domain (apex zone), or if you need other records for the same name. - Use the
URLrecord if you want the name to redirect (change address) instead of resolving to a destination.
No comments:
Post a Comment