Is there a way to connect my domain with heroku using nameservers - heroku

I have a domain that I bought from dataplugs. They don't support CNAME configuration. They only have nameservers. In there cpanel, there is an option for alias domain, but it is not working instead it redirects to my heroku sub-domain. I researched about it everywhere but didn't get a proper answer. One way I find on the internet that uses a pointdns (a heroku plugin) but I'm not sure about that, I didn't saw any option to add nameservers. Thanks for your answer.

Some domain name registrar allows aname/alias to point naked/root domain, but if this is not working in your case, then you can use pointDNS.Please try to follow the below-mentioned steps
Go to APP -> settings-> under domain section add below domains
domainname.com
www.domainname.com
Go to resources-> add PointDNS addon,
Verify by clicking on pointDNS
Copy all NS records from dataplug to pointDNS
Update NS issued by pointDNS (dns8.pointhq.com,dns12.pointhq.com) in
dataplug

Related

How to associate Heroku app with a Google domain?

I purchased a domain with Google and I would like to associate it with a Heroku app. What is the step-by-step process to achieve that?
I recently connected my app to a custom domain. Although my domain is purchased from AWS route53. I think the approach generally is the same.
First of all, you can check out this page written by Heroku. https://devcenter.heroku.com/articles/custom-domains
I believe the tutorial given by Heroku works. However, I am tired of all those CLI that make things unvisable XD. Luckily, we can configure it from the Heroku website instead of the CLI.
Here is my approach:
First open your app in the Heroku web page, then click the "Settings" button
https://dashboard.heroku.com/apps/{your app name}
Scroll down until you see the "Domains" section, Then click "Add domain"
https://dashboard.heroku.com/apps/{your app name}/settings
Input the domain name you purchased from google (eg. www.example.com)
After adding your domain, Heroku will give you the DNS target.
From your google domain DNS management page, you should be able to add a new record for your hosted zone.
Finally, add a new record with simple routing policy, type CNAME, and value equals to the DNS target provided by Heroku.
It is really simple if you follow these steps correctly. Due to my reputation level, I cannot upload photos. Feel free to contact me if you want some image to guide you how to locate the buttons :)
It’s only 3 steps:
1. Heroku, in your app > Settings > Add your domain:
Add www.[foo.com] (Note: www is KEY!) to your app
Copy the [DNS Target] it gives you
2.Google Domains > DNS > Resource records > Custom Records > Manage Custom Records:
www, CNAME, [DNS Target]
Now you’re basically set up. If someone goes to https://www.[foo.com] in a few minutes, they’ll see your Heroku app hosted at [DNS Target]. But if they go to any other permutation (http, non-www) they’ll get a 404 error. To solve this, we’ll set up permanent redirects to the main version in the next step.
Google Domains > Website > Add a Forwarding Address:
From Field: [foo.com]
To Field: https://www.[foo.com]
Permanent Redirect (301)
Forward Path (so that [foo.com]/about forwards to https://www.[foo.com]/about)
SSL Enabled
Boom. Wait a couple of minutes for DNS to catch up, and you’re done.
heroku certs:auto:refresh
In Terminal refresh the SSL cert settings on Heroku, and check the Heroku Dashboard to confirm everything’s working.
Confirm all the below permutations forward to your site correctly:
https:
https://www.[foo.com]
https://[foo.com]
http:
http://www.[foo.com]
http://[foo.com]
paths:
https://www.[foo.com]/about
http://[foo.com]/about
PS: So does this work for the naked domain like [foo.com] instead of www.[foo.com]? No! Google Domains does not support ALIAS domains, and therefore in combination with Heroku does not support forwarding to the naked (aka. root aka. apex) domain. Sorry! This surprised me too :( Source 1: Heroku Docs | Source 2: StackOverflow. Your only alternative here is to transfer your domain (which costs money) to something like Cloudflare.
A working answer with these explanations is taken from https://nikodunk.com/heroku-ssl-google-domains-2019/
Just to add to Fergus's answer, if you are seeing the warning "cant add cname records as root domain" add www to the host name input.

PointDNS - "Name is managed by another account" on Heroku App

I'm trying to add a domain at one of my heroku apps.
I just added a custom domain in the app, but when I open PointDNS(DNS host recommended by heroku), my domain isn't listed there.
It shows the message You haven't added any domains yet. Go ahead, and add your first domain.
Then, when I try to add the domain name, it says Name is managed by another account.
I checked all my other apps, and no one have this domain registered. I've also tried the command heroku domains -a my-app and it correctly shows me the registered domain.
Summarize: I can't manage a domain in PointDNS due to the error Name is managed by another account, but there is no another account with this same domain. What could the problem be?
Since I couldn't solve the problem with PointDNS support, I've decided to transfer my website onto another domain registrar. That's it.

How to connect a heroku app to a wix domain?

I bought a year plan with a free domain on wix.com for my portfolio. Now I've coded my portfolio and deployed on heroku. How can I disconnected my original wix-made portfolio page with the domain and connect the domain with my heroku app?
I've tried add domain and also edited my DNS Record on wix's domain dashboard (advanced tab).
screen shot of the wix dashboard: https://drive.google.com/file/d/17LzbD-DKn-QMH9adFdZVrtjE72gB_dvh/view?usp=sharing
To be specific, I only changed the CNAME's 'points to' section to the 'DNS Target'([something].herokudns.com) provided by heroku. (I've also tried to put [appname].herokuapp.com in the field)
screen shot of the heroku setting:
https://drive.google.com/file/d/1Gwxxe9VpO8zpSHNE1lfWPs0VJk4HB-fi/view?usp=sharing
Finally, I hope I can see my new self-coded portfolio when I visit the domain I got from wix.
As per your screenshot there is A record in ns which needs to be removed. I think you are pointing via cname which can be considered as an alternate option but would recommend you to add a addon on heroku name pointDNS and copy all the records from wix.com to pointDNS.Please try to follow below mentioned steps
1. Add the domain to your heroku app => heroku domains:add domainname
2. Go to resources-> add `PointDNS` addon,
a.Verify by clicking on pointDNS
b.Copy all NS records from wix to pointDNS
c.Update NS issued by pointDNS (dns8.pointhq.com,dns12.pointhq.com) in wix

How to configure DNS records for Name.com and a Heroku app

I'm a bit confused about how to set up the DNS records for my domain at Name.com so it can correctly point to my Heroku app.
I found DNS configuration documentation at heroku's site but I'm still confused.
I'm under the impression that I need to set up a CNAME record for all subdomains and an A record for my root domain.
Also, on the name.com website, when I try to add a CNAME there are three blank fields I need to fill out which kind of confuse me: "Host" (where I enter '*' so it applies to all subdomains?), "Answer" (where I enter the DNS Target?), and "TTL"
Any help would be greatly appreciated. Thank you.
Fully detailed steps (2)
1). Visit Heroku apps dashboard
Choose your app
Click "Settings"
Find text "Add Domain", click button
Add your site with www subdomain:
www.yoursitename.com
Copy the returned "DNS target" value
2). Visit your name.com account
Find link text "Manage DNS Records" and visit link
"ADD RECORD" row with the following content:
Type:
Host:
Answer:
CNAME
www
📋 DNS target value from clipboard
(SAUMITRA KUMAR's answer, is what helped me write this answer.)
Don't use an A-record for your root domain. Heroku is using volatile IP addresses, which means the IP you configure in your A record can stop working at any moment without notice.
See https://devcenter.heroku.com/articles/apex-domains
On your root domain, you need to either setup an HTTP redirect to your www subdomain with your DNS provider, or use another provider which offers CNAME records for root domains.
As for the CNAME in your subdomains, yes, "Host" would be "*" to be all your subdomains.
Answer will be the endpoint provided by heroku, in the form appname.herokudns.com..
TTL means how often the DNS cache should be refreshed with the clients. Using the default (or 3600 if they don't provide any) will work here.
Here's what worked for me. Start with typing this in the Heroku CLI
Heroku domains: add www.youwebsitename.com --app yourherokuapp
This should give you a DNS target.You can obtain this from the your app settings as well on the website . Copy it and save it because we are going to need it later.Then after this run
heroku domains:wait for www.youwebsitename.com --app yourherokuapp
Then visit name.com and under your domains visit your dns records . There add CNAME entry with HOST equal to "www.yourwebsite.com" and ANSWER equal to whatever the dns target that heroku supplied you with .
Go ahead and visit your website , it'll work , if it doesn't make sure that you've used www with your website name . To fix this issue add an ANAME entry with "yourwebsite.com" as HOST and heroku dns again as target . It should reflect the changes within few hours .

Providing customers with domain aliasing

Currently I have an app which gives my users a custom subdomain.
neat.coolapp.com
However, I want my users to be able to CNAME their personal domain to that website.
ex. hey.neat.com -> neat.coolapp.com
Is this possible on heroku?
Thanks in advance for any insight.
You'll need to add whatever domain the customer wants to use to your application so the correct application on Heroku responds - you could do this either manually (via the heroku control panel) or use the heroku gem within your application to add the domain to your application via some kind of control panel if the customer is able to add their own domains.
In regards to cname's - I would suggest setting up something like proxy.yourwebsite.com as a CNAME to yourapp.heroku.com and then you get your customers to cname their domain to proxy.yourwebsite.com in their DNS config.
When you sign up for Heroku you will get a subdomain like
asdf.heroku.com
If you have a domain like mywebsite.com you can cname mywebsite.com to asdf.heroku.com and you will need to add mywebsite.com to Heroku's custom domain command.
From there I'm not sure, if you wanted to add mywebsite2.com without having to add it using the custom domain command you can try to cname it to mywebsite.com, if you have two domains you can try it out.

Resources