8

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?

DenCowboy
  • 13,884
  • 38
  • 114
  • 210
  • What is the exact issue? – mdeora Jul 30 '18 at 11:28
  • I want that everything is redirected to https://www.example.com. The issue is the fact that when I visit example.com I got redirected to https://example.com instead of https://www.example.com. I hope you understand? (http to https redirect is working fine, but url not) – DenCowboy Jul 30 '18 at 16:37
  • Your DNS provider should have the service to redirect a root (apex) domain to www or https. Otherwise you need to have a server to accept the root domain https request and than in request header redirect to www. – mdeora Jul 30 '18 at 18:14
  • I don't fully understand, but so just changing some configuration described above won't be enough? – DenCowboy Jul 30 '18 at 20:36

1 Answers1

1

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.

nbari
  • 25,603
  • 10
  • 76
  • 131
  • and do you know how this works for pointdns? https://devcenter.heroku.com/articles/pointdns – DenCowboy Jul 31 '18 at 19:21
  • Cool; I'll try! Are those changes executed immediatly or do I have to wait one hour with TTL 3600? – DenCowboy Jul 31 '18 at 19:47
  • @DenCowboy I don't think you will have to wait for the redirect, give a try – nbari Jul 31 '18 at 19:49
  • I can only give the bounty in 18 hours. I've implemented it but it seems I have to wait for 1 hour now (read it) – DenCowboy Jul 31 '18 at 21:17
  • @DenCowboy in any case you could also use cloudflare I think is easier – nbari Aug 01 '18 at 04:43
  • Everything works with the redirect except I'm facing a NET::ERR_CERT_COMMON_NAME_INVALID error when go to https://www.example.com (going to http://www.example.com redirects fine) – DenCowboy Aug 01 '18 at 08:15
  • Do I need to transfer my domain in some way first? My domain entry on PointDNS has status "red". I also have DNS entries in AWS Route 53, I found a way to export them, but I'm not sure if I need to transfer my domain name or something – CQM Nov 19 '18 at 15:20
  • @CQM: No you don't need to transfer your domain if you are using services like pointDNS. – svikramjeet Apr 22 '19 at 12:05