To achieve the goal of making your web application accessible via a custom subdomain ( subName.yourDomain.com ) instead of the default URL provided by Heroku (‘https://abc-dev-d13413412341234123.herokuapp.com/login’), you can follow these steps:
1. Set Up the Custom Domain on Heroku:
Before configuring the DNS on InMotion Hosting, you need to add the custom domain to your Heroku application.
- Log in to Heroku:
- Access your Heroku dashboard and navigate to the application you want to configure.
- Add Custom Domain:
- Go to the Settings tab for your application.
- Scroll down to the Domains section.
- Click on Add domain and enter subName.yourDomain.com
- Heroku will provide you with a DNS target (it will look similar to
darwinian-egret-1u2341341341.herokudns.com).
- Copy the DNS Target:
- Copy the DNS target provided by Heroku, as you will need this to set up the CNAME record in your DNS.
2. Configure the DNS on InMotion Hosting:
Next, you need to set up a CNAME record in InMotion Hosting to point dev.remclouds.com to the Heroku application.
- Log in to cPanel:
- Access your InMotion Hosting account and log in to cPanel.
- Go to DNS Zone Editor:
- In the Domains section of cPanel, click on Zone Editor.
- Add a CNAME Record:
- If subName.yourDomain.com does not already exist:
- Click on +CNAME Record next to your main domain (
yourDomain.com). - For the Name, enter subName (it will automatically append
.yourDomain.com). - For the CNAME, paste the DNS target you copied from Heroku (e.g.,
darwinian-egret-1dfadfa213412342r.herokudns.com). - Set the TTL to 3600 seconds (1 hour) or leave it as the default.
- Click Add Record or Save.
- Click on +CNAME Record next to your main domain (
- If subName.yourDomain.com does not already exist:
Important: Need to remove all A records that associated with the subName.yourDomain.com