Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gandi.net and Heroku Domain Routing

Tags:

heroku

dns

My .io domain works for www.domain.io, but not for the domain.io version. Below are each of the versions and revisions I have tried with ample time between each. I al

@ 10800 IN A 174.129.212.2
@ 10800 IN A 75.101.145.87
@ 10800 IN A 75.101.163.44
blog 10800 IN CNAME blogs.vip.gandi.net.
imap 10800 IN CNAME access.mail.gandi.net.
pop 10800 IN CNAME access.mail.gandi.net.
smtp 10800 IN CNAME relay.mail.gandi.net.
webmail 10800 IN CNAME webmail.gandi.net.
www 10800 IN CNAME domain.herokuapp.com
@ 10800 IN MX 50 fb.mail.gandi.net.
@ 10800 IN MX 10 spool.mail.gandi.net.

@ 10800 IN A 174.129.212.2
@ 10800 IN A 75.101.145.87
@ 10800 IN A 75.101.163.44
www 10800 IN CNAME domain.herokuapp.com

@ 10800 IN A 174.129.212.2
@ 10800 IN A 75.101.145.87
@ 10800 IN A 75.101.163.44
www 10800 IN CNAME domain.herokuapp.com.

removed @ lines because of Gandi and Heroku set up issue

www 10800 IN CNAME domain.herokuapp.com.

From reading other answers like How to setup DNS for an apex domain (no www) pointing to a Heroku app?, it seems that it best to redirect from the root domain to the one with www. Any other way?

Also are the lines for gandi.net are necessary?

like image 658
Patrick Avatar asked Apr 04 '14 05:04

Patrick


People also ask

How do I redirect my domain to Heroku?

Go to the record editor and two DNS records, one for each host name, pointing to the Heroku SSL endpoint: Add an ALIAS record to point example.com to Heroku. Leave the Name of the record empty and set the Content field to the SSL endpoint example.com.herokudns.com. Add a CNAME record to point www.example.com to Heroku.

Does Heroku work with GoDaddy?

GoDaddy does NOT Support Heroku.

Does Heroku give free domain?

Domains can be added to both free and paid Heroku apps and adding domains does not incur extra charges. For verification purposes, you must verify your Heroku account to add domains to apps.

Can you buy a domain through Heroku?

Note: Heroku does not host domains and you cannot buy a domain through Heroku.


1 Answers

it seems that it best to redirect from the root domain to the one with www. Any other way?

As of right now, no. Unfortunately, ALIAS records are not used by Gandi, and A records are not available for use with Heroku because Heroku does not use fixed IP addresses.

The record type that both Heroku and Gandi recognize is the CNAME record, which can not be used for bare domains. Or, at least, shouldn't be used for bare domains. See https://superuser.com/questions/264913/cant-set-example-com-as-a-cname-record.

And for anyone lost, looking for how the heck to implement this, here's my cheat sheet for the work-around.

Step 1: In Gandi, set DNS zone file.

Name  Type     Value

@     A        217.70.184.38  # Gandi's server
*     CNAME    my-app.herokuapp.com.  # trailing . is required
www   CNAME    my-app.herokuapp.com.  # trailing . is required

Step 2: In Gandi, set web forwarding for the domain.

The type of forwarding will be 'direct (permanent)', leave the subdomain blank, and set the forwarding address as www.my-custom-domain.com.

Step 3: In Heroku, set Heroku custom domains.

Domain Name                 DNS Target

*.my-custom-domain.com      my-app.herokuapp.com
my-custom-domain.com        my-app.herokuapp.com
www.my-custom-domain.com    my-app.herokuapp.com
like image 144
SarahJaine Avatar answered Oct 14 '22 04:10

SarahJaine