Noma4i
Noma4i

Reputation: 770

Point top level domain to heroku app

I want to point mysite.com to myapplication.herokuapp.com

Searched hard and was speaking with hostgator support, they say - it is impossible, heroku is not supporting A records and CNAME are not able to point from naked domain.

Upvotes: 2

Views: 3655

Answers (2)

mipadi
mipadi

Reputation: 410542

You can do it with A records…but Heroku really doesn't want you to, and with some good reasons. One thing you can do is run

$ host myapplication.herokuapp.com

and find out what IP that points to, and then create an A record pointing to that IP. But this is very brittle: if Heroku changes that IP, then your domain won't work until you update your A record. This method will probably break at some point, so you shouldn't do it, even though you technically can.

Luckily, there are solutions. Heroku outlines them in their documentation for custom domains, particularly in their documentation for root domains. The best one is to use a DNS provider that supports "ANAME" or "ALIAS" records, which are like CNAME records in that they point to another domain (rather than IP), but can be used for root domains. DNS doesn't natively have such support, so these are a bit of a hack, and are only supported by a few providers, namely DNSimple and DNS Made Easy. This solution is the best, most robust solution.

I use DNSimple and have found them to be very reliable and excellent to work with.

Upvotes: 4

Subfuzion
Subfuzion

Reputation: 1929

This question was already asked and answered here: https://stackoverflow.com/a/16041655/758334

I can vouch for dnsimple. There was a number of reasons why I switched to them, but their support for ALIAS records to make pointing the apex domain to hosted cloud apps was a big one for me.

Upvotes: 3

Related Questions