Julius S.
Julius S.

Reputation: 704

A record for domain.com and CNAME for www.domain.com?

How do I achieve that people get to my website with "domain.com" and "www.domain.com" ? I always thought both would be the same.

Do I set an A record to "domain.com" and a CNAME to "www.domain.com"? And is "www.domain.com" a subdomain of "domain.com"?

Upvotes: 0

Views: 1821

Answers (1)

Ira
Ira

Reputation: 496

Yes, you are absolutely right! www.domain.com is a subdomain of domain.com. You should always set up A record for the root domain (i.e domain.com) and CNAME for the subdomain and not vice versa. The point is that CNAME has the highest priority and supresses all other records for the hostname. Thus, let's say if you have mail service set up on your root domain name, like [email protected] and CNAME, mail will not work or will work intermittently.

Upvotes: 1

Related Questions