A
A
Alexander Kurganov2014-01-22 19:32:17
Domain Name System
Alexander Kurganov, 2014-01-22 19:32:17

DNS issue when linking a domain to Heroku

There is a domain, let's say domain.co, bought in GoDaddy, there is a node.js application in Heroku, development is carried out locally, then it is checked on a droplet in Digital Ocean, then when everything is fine, it is deployed to Heroku.
And I wanted domain.co to look in Heroku, staging.domain.co in Digital Ocean, and domain.dev worked locally, there were no problems with the latter, but with the first two, yes.
I can’t set it up in any way, tell me how to implement it ideologically correctly?
Do not suggest solutions with adding A records of Heroku IPs, it seems to me that this solution is completely wrong.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-01-22
@bondbig

Well, you need to create three records in the DNS:
domain.co - A-record with the IP address heroku
staging.domain.co - A-record with the IP address digitalocean
domain.dev (or better dev.domain.co) - A-record with the IP address 127.0.0.1 (or whatever local server it is if it's not a development machine)

@
@proffard, 2014-07-11
_

A heroku app does not have an IP, but always has a service domain appname.herokuapp.com
To make domain.co look at heroku, you need to do the following steps:
1. heroku domains:add domain.co -a appname
2. Create a CNAME record for the domain.co domain with the value "appname.herokuapp.com"
More details in the official heroku documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question