DenCowboy
DenCowboy

Reputation: 15076

How to configure DNS on Heroku (pointdns)

I have the following configuration in pointDNS:

* SOA example.com dnsx.pointhq.com, admin.xxx.com, ...
* ALIAS example.com xxx.herokussl.com.
* CNAME www.example.com. xxx.herokussl.com. (same as above)
* NX example.com dnsx.xxx.com (same as above)
* NX example.com dnsy.pointhq.com (different)

I did not make this initial configuration and now trying to understand what this means.

The main issue is the fact when we visit example.com we are redirected to https://example.com and when we visit www.example.com we're redirected to https://www.example.com.

How can I solve this in the configuration above?

Upvotes: 8

Views: 2440

Answers (1)

nbari
nbari

Reputation: 26925

In case you would also like to receive/send email using your custom domain, probably the easiest way would be to use Cloudflare, check Heroku docs for: Configuring DNS for root domains

Within Cloudflare to redirect example.com to www.example.com you could create a Page rule:

example.com/*

You'd then setup the following URL for traffic to forward to:

https://www.example.com/$1

To do the redirect with PointDNS you will have to delete first the Alias:

enter image description here

Then click on the redirect icon and don't type any name: enter image description here

If you haven't delete the ALIAS record you will get the warning shown in the picture

enter image description here

Once you create the redirect it should look like this:

enter image description here

Common Runtime - SSL Endpoint

If you’re using the SSL Endpoint, note that your DNS Targets will be a little different. For apps in the Common Runtime, the endpoint domain name will vary depending on region. The US region will have a name in the form of example-2121.herokussl.com. Apps in the EU region will have the same domain name as your app’s herokuapp domain, e.g. my-app-name.herokuapp.com.

Upvotes: 1

Related Questions