title: Redirecting naked URL to www DNS issues
body: <p>I'm on heroku and I'm trying to get <code>http://domain.com/*</code> to redirect to <code>http://www.domain.com/*</code>. Using <code>rack-rewrite</code>, I got <code>http://myapp.herokuapp.com/*</code> to successfully redirect to <code>http://www.domain.com/*</code>. I can't however get <code>http://domain.com/*</code> to redirect to <code>http://www.domain.com/*</code>.</p>
  
  <p>Looking at a <a href="https://stackoverflow.com/questions/10395184/rails-proper-setup-with-dns-rack-rewrite-etc-for-heroku">similar thread</a>, it seems I'm supposed to set my A record to point to myapp.herokuapp.com. I could set my CNAME (www) to myapp.herokuapp.com, but when I tried to do so with my A record I got this error:</p>
  
  <pre><code>INVALID_IP: 'myapp.herokuapp.com' is not valid IP for A record. (host name: @)
  </code></pre>
  
  <p>I've tried it with <code>myapp.herokuapp.com.</code> as well but I get the same error. What am I doing wrong? I've also tried setting @ to other record types but none gives me the <code>http://domain.com/*</code> I'm looking for. Any help would be greatly appreciated. </p>
  
  <p><strong>EDIT:</strong> Ok so setting @ to a CNAME completely fixed the problem. I'm not sure why everything I've read referenced A record though.</p>