2

I have a heroku app with the following settings:

Domain name: www.localhost.com
DNS Target: safe-springs-1527.herokuapp.com

The domain is on GoDaddy. The settings there are:

A (Host) 
0 Records (0 Selected)

AAAA (IPv6 Host) 
0 Records (0 Selected)

CName (Alias) 
Host Points To
email   email.secureserver.net
ftp safe-springs-1527.herokuapp.com
www safe-springs-1527.herokuapp.com

When I try to createa a CName record which will be with host "@" and to point to "safe-springs-1527.herokuapp.com" I get the error The specified record already exists. CNAME - @.

My website is accessible when I use www.localhost.com but not when I use localhost.com.

I also have in mind what is needed is an A record which points to an IP. Unfortunately heroku gives me a dynamic host which its IP changes.

I posted this issue on reddit and through the discussions I understood that what I am trying to do is not possible and the only solution would be to move to CloudFlare. I am not sure if I have to move my domain or app there but my concern is different. I just can't grasp that. I can't believe that all apps on heroku have this issue.

Is this the case or am I missing something (on heroku's or godaddy's end or...)?

1

I found this on Heroku and now my domain works fine without the www. I am not sure what it does.

In short:

Root domains must be added in addition to any subdomains. The process for adding root domains is the same in the Heroku CLI:
$ heroku domains:add example.com
Adding example.com to example... done
!    Configure your app's DNS provider to point to the DNS Target example.herokuapp.com
!    For help, see https://devcenter.heroku.com/articles/custom-domains
0

Use http://redirect.name/ and set the DNS records it specifies there to redirect your www domain to the naked domain, or vice-versa.

Apparently it is better for SEO to have one "canonical" domain, with or without www. The other should be a redirect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.