4

Let example.com be the main blog with a lot of articles about different topics. Now I want to have topic1.example.com to show only posts related to topic1.

The Rails application that powers the blog is already configured to respond accordingly when the request comes from the subdomain.

Now my question is about DNS configuration of subdomain: should I use a CNAME which "redirects" to example.com or should I use an A record (even for the subdomain) which points to the same IP of example.com?

collimarco
  • 264
  • 2
  • 3
  • 10

1 Answers1

4

In this case, both approaches are equally valid.

  • As long as they both are on the same IP adress, having a CNAME means that it will be simpler if you ever need to change that IP address - you will only need to change it in one place, instead of two.

  • If you think you will want to separate them to different IP addresses within the near future, you may as well put in an A record now. But it's just as easy to just change it from a CNAME to an A record if/when that ever happens, so it really doesn't make any difference.

For the clients connecting to the site, there will be no difference whatsoever between an A record and a CNAME.

Jenny D
  • 27,780
  • 21
  • 75
  • 114