Skip to content

Setting Up Website DNS

Services used

  • DreamHost
    • used as the domain registar
    • also handles domain emails
  • Heroku
    • hosts the websites and apis
  • Cloudflare
    • handles the DNS and SSL

Set Up Steps

  1. Domain needs to be purchased on DreamHost
  2. Heroku frontend app needs to be deployed
    • add both the www and non-www domain names
    • configure ssl for certificates to be auto managed
  3. Add the domain to cloudflare
    • can do much of the onboard automatically
    • DNS records should contain 2 CNAMES and 3 NS records
      • NS records should match the DreamHost NS records
      • CNAMES are as follows, content values come from Heroku
        TypeNameContentProxy StatusTTL
        CNAME@name.herokudns.comOrange CloudAuto
        CNAMEwwwname.herokudns.comOrange CloudAuto
  4. DreamHost domain config needs to be as follows
    • DNS Only
    • DreamHost NS records
    • custom record that is
      NameTypeValue
      wwwCNAMEname.herokudns.com
      • CNAME will be for the www domain on Heroku
    • will have custom Nameservers from cloudflare
  5. Update Nameservers from Cloudflare on DreamHost
  6. Turn off proxies (orange cloud) for both domains then turn off "Always Use HTTPS" and "Automatic HTTPS Rewrites" in Cloudflare SSL Edge Certificates
  7. Refresh ACM Status in Heroku
    • should end up with an ACM status of "OK" for both domains
      • if not, try removing and readding both domains
        • heroku domains:remove domain.com --app heroku-app
        • heroku domains:add domain.com --app heroku-app
  8. Turn proxies and HTTPS settings back on in Cloudflare
  9. Test both domain types in an incognito window
  10. domains should route correctly and be secure - setup is complete 🎉