0

Cloudflare said Add an A, AAAA, or CNAME record for www so that *mywebsite.com* will resolve

So which record is the best to resolve it? A, AAAA or CNAME?

And should I enter the record NAME to be www.mysite.com or just www?

Dave M
  • 4,494
  • 21
  • 30
  • 30
cilapo1541
  • 43
  • 1
  • 5

2 Answers2

1

Create an A record mywebsite.com:A=[IP address], then create a CNAME record www.mywebsite.com:CNAME=mywebsite.com. Then later, if you change IP address for mywebsite.com, lookups for www.mywebsite.com also resolve to the newer IP address.

Instead of the CNAME, you can create www.mywebsite.com:A=[IP address], and it'll have the same effect. There's not really a lot of reason to choose one over the other.

You can probably ignore AAAA records, and you might not even have an IPv6 address anyway. But if you want/need to, you can create mywebsite.com:AAAA=[IPv6 address]. Then the CNAME record at www.mywebsite.com will then resolve to both A and AAAA records.

w5m
  • 151
  • 8
jezzaaaa
  • 66
  • 4
0

There is no best one.

The ONLY one that can resulve www to non www is CNAME.

The others can point to the SAME IP ADDRESS - but technically this is not the same and your question (pobssibly by acceident) is quite clear on the technical demand.

The difference is:

AAA / A (one is IPV6, one IPv4) point to an IP Address CNAME points to an A / AAA entry (not another CNAME).

As such, if you would use A / AAA - one could move the non-www to another address and your www would still point to the old address. Not what you ask for.

CNAME "reuses" the non-www-entry (i.e. the client queries again for the non-www) and thus does exactly what you ask for.

Note that CNAME is slower. THis is like asking whther breathing once more will slow you down for the day - the time for a request (given that all things should be cached by a quite local DNS - either in house or at your ISP, and by your computer as last resort) is absolutely trivial so the slow down by the second request is mostly academic and a rounding error with no practical relevance.

TomTom
  • 50,857
  • 7
  • 52
  • 134