www a-record vs cname-record
The difference between having an A record vs CNAME for www would be an extra look up. In case of the CNAME the after figuring out that www is a CNAME to example.com, another look will be done for example.com.
Other than that if you are planning to use a CDN or a 3 party acceleration service then a CNAME would come into play. Example a lookup of www.google.com results in the following. Notice the difference in TTL of www.l.google.com and www.google.com
www.google.com. 36545 IN CNAME www.l.google.com.
www.l.google.com. 294 IN A 209.85.153.104
This gives the flexibility of changing the record, keeping a lower TTL, doing fancy stuff like geo redirection, if employing third party services.
In your case it doesn't matter since you are pointing both to the same IP.
There is no rule that the www.
address needs to be an A record. It is very common for a web site to be a CNAME
to something else. For example:
$ host www.google.com
www.google.com is an alias for www.l.google.com.
Or:
$ host www.kodak.com
www.kodak.com is an alias for www.Kodak.com.edgekey.net.
If things aren't working for you, it suggests a configuration error. Without seeing your actual DNS records it's hard to help out, but using command line tools like dig
can help you debug the problem by showing you exactly what DNS records are being exposed by your name servers.