Set up Naked Domain for Heroku application

Set up naked omain on Heroku
It's a rule of thumb where you have a website addressed at, your users type then your sites end display the www one to your users.  Yes, both www and naked domain should be the same webpage, ideally. Even your app is hosted on Heroku, it's not an exception.

However, Heroku said this on its documentation about naked domain (apex domain):
For maximum scalability and resiliency applications should avoid using DNS A-records and instead use a DNS provider that supports CNAME functionality at the apex, or use sub-domains exclusively.
And naked domain can't be configured with CNAME records. That means, you need a workaround. Pointing to A-records is not recommended since Heroku can change the IP address anytime they need or they want.


If your DNS provider provides you with ANAME , you can use it. Just entered your naked domain with the value: and you're done. Unfortunately, not many DNS providers provide you with ANAME. Knowing this, I think another workaround: 301 redirection, which is permanent redirection. You need to set up a HTTP redirection from your naked domain to your www one. As my experience so far, there are many DNS providers provide this HTTP-redirection feature. 

That way, if anyone type your naked domain on their web browser, they will be redirected to

P.S. The post assumed you're already familiar with DNS management dashboard and its feature such A-record, CNAME, ANAME, HTTP-Redirection, MX records, and others.