Gandi.net and Heroku Domain Routing

后端 未结 3 1439
再見小時候
再見小時候 2021-02-07 21:31

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

         


        
3条回答
  •  野的像风
    2021-02-07 22:11

    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
    

提交回复
热议问题