4 ms·
You're right that using an A record isn't great because your hosting provider loses the flexibility of being able to change IP addresses. This article explains
by masnick 14y ago
You're right that using an A record isn't great because your hosting provider loses the flexibility of being able to change IP addresses. This article explains it really well: https://devcenter.heroku.com/articles/avoiding-naked-domains-dns-arecords https://devcenter.heroku.com/articles/avoiding-naked-domains...
My solution is to use CloudFlare for my DNS (it's free, why not?) and use their "page rules" feature to do a 301 (permanent) redirect from domain.com/* to www.domain.com/$1.
You can see what happens if you run `curl -I maxmasnick.com`.
dnsimple.com (another DNS provider) also lets you add a "URL" record, which also is a 301 redirect.
One should be careful with 301 redirects because the are cached locally and quite thus permanent (see: http://www.jacquesmattheij.com/301+redirects+-+a+dangerous+one+way+street http://www.jacquesmattheij.com/301+redirects+-+a+dangerous+o...). But in this case I think this is what you want.