2

I want to make a domain point to my Heroku app, so I am trying to create an A record that targets myapp.herokuapp.com.

The problem is that the domain provider requires an IP address, and I cannot find any IP address for my Heroku app. I guess it might be something about Heroku only having dynamic IP addresses (and thus no static IP addresses).

How can I fix this problem? Can I make Heroku use static IP addresses?

Jamgreen
  • 121
  • 1
  • 2

2 Answers2

0

There are heroku apps for that. Take a look at https://devcenter.heroku.com/articles/fixie

tarhim
  • 1
  • 1
0

Instead of an A record, use a CNAME (alias) record. CNAMEs point to other names. So you don't have to worry about knowing the IP.

www.myapp.com.  CNAME   myapp.herokuapp.com.
Ryan Bolger
  • 16,472
  • 3
  • 40
  • 59
  • You cannot use `CNAME` records on a zone apex – Torin Nov 20 '18 at 09:27
  • Generally speaking, that's correct. But there are a number of DNS providers that now provide virtual CNAME records that *can* be used on the zone apex. The server implementations basically resolve the A records at query time and return them as if you had added a normal A record. – Ryan Bolger Nov 20 '18 at 16:15
  • Some DNS providers use a virtual record type generally called an `ALIAS` (distinct from `CNAME`) which acts like `CNAME` only for `A` and `AAAA` record types. No DNS provider should ever treat a `CNAME` record like this since it's completely incorrect behaviour. It is very specific how a `CNAME` should be handled, including that it should never be at a zone apex. – Torin Nov 20 '18 at 16:35
  • I modified my example to remove the apex CNAME, because you're right that it's wrong. But like you said, the solution for apex records is still possible depending your your DNS provider. – Ryan Bolger Nov 20 '18 at 17:10