What is the correct DNS CNAME target for my Custom Domains?

Issue

There are several different CNAME targets for DNS, herokuapp.com, herokudns.com, and herokussl.com. Which one should you use?

Resolution

All Heroku applications are browsable via the your_app_name.herokuapp.com address, however, to use Custom Domains, you will need to setup your DNS to use the correct CNAME targets, which differ depending on how your application is setup.

If your application uses the SSL Endpoint addon:

You can check the correct CNAME target for SSL Endpoints by running the Heroku CLI command: heroku certs -a your_app_name.

  • For applications hosted in our US region, the CNAME target will be: endpoint_name.herokussl.com
  • For applications hosted in our EU region, the CNAME target will be: your_app_name.herokuapp.com

Please note: herokussl.com addresses are not browsable, they will not display your application, as they are only intended to host your SSL certificate.

Full information is available on our Dev Center: SSL Endpoints DNS and domain configuration

If your application uses our new Heroku SSL (SNI) or Automated Certificate Management:

Your CNAME targets will use our new herokudns.com address. Each custom domain will be assigned it's own address. E.g., the custom domain www.awesome-co.com, will have the www.awesome-co.com.herokudns.com CNAME target setup. You should add DNS CNAME records for each of your custom domains to point to the corresponding herokudns.com target.

You can check the correct CNAME target for Heroku SSL (SNI) by running the Heroku CLI command: heroku domains -a your_app_name.

You might have old Custom Domains that still display a your_app_name.herokuapp.com CNAME target. You should remove, and re-add these to ensure a herokudns.com CNAME is set up.

Please note: herokudns.com addresses are not browsable, they will not display your application, as they are only intended to host your SSL certificate.

Full information is available on our Dev Center: Heroku SSL and Automated Certificate Management

If your application is only accessed via HTTP and does not use any SSL:

You can check the correct CNAME target for Custom Domains by running the Heroku CLI command: heroku domains -a your_app_name.

  • Custom Domains created before herokudns.com was available will display your_app_name.herokuapp.com as the DNS CNAME target.
  • Custom Domains recently created will display your_custom_domain.herokudns.com as the DNS CNAME target.

You should setup your DNS CNAME targets based on these settings, although using your_app_name.herokuapp.com will work for both OLD and NEW Custom Domains. If the your_custom_domain.herokudns.com is available for the Custom Domain, then you should use this as it will make transitioning to Heroku SSL easier in the future.

Please note: herokudns.com addresses are not browsable, they will not display your application, as they are only intended to serve as a CNAME target.

How to test your DNS is setup correctly:

DNS changes take time to propagate, usually this happens within a few minutes to an hour, but this can longer depending on your DNS provider. You can check your DNS by using online tools such as http://zone.vision, or using the command line tools dig and host