How to configure DNS records for Name.com and a Heroku app

后端 未结 2 964
[愿得一人]
[愿得一人] 2021-01-13 07:01

I\'m a bit confused about how to set up the DNS records for my domain at Name.com so it can correctly point to my Heroku app.

I found DNS configuration documentation

2条回答
  •  清酒与你
    2021-01-13 07:40

    Here's what worked for me. Start with typing this in the Heroku CLI

    Heroku domains: add www.youwebsitename.com --app yourherokuapp 
    

    This should give you a DNS target.You can obtain this from the your app settings as well on the website . Copy it and save it because we are going to need it later.Then after this run

    heroku domains:wait for www.youwebsitename.com --app yourherokuapp 
    

    Then visit name.com and under your domains visit your dns records . There add CNAME entry with HOST equal to "www.yourwebsite.com" and ANSWER equal to whatever the dns target that heroku supplied you with .

    Go ahead and visit your website , it'll work , if it doesn't make sure that you've used www with your website name . To fix this issue add an ANAME entry with "yourwebsite.com" as HOST and heroku dns again as target . It should reflect the changes within few hours .

提交回复
热议问题