I am trying to use my hostgator registered domain on my node.js application deployed through heroku.
I have added the domain to my heroku application through the custom domain feature, and when i type "Heroku Domains" in the console, it shows up with a target of: "photosbysalwa.com.herokudns.com" and a type of ALAIS or ANAME.
When I try to add an ANAME record through hostgator, I try to set the address to "photosbysalwa.com.herokudns.com" but it won't let me submit the record because it says the address must be an IP address.
If you could help me with how to get the domain pointed, that would be fantastic.
Check this video its about how to point your domain name to heroku hosting.
It have godaddy domain name and its the same way to hostgator I think
in the heroku page in the settings add three domains:
1 *.xyz.com
2: xyz.com
3. www.xyz.com
open your Hostgator account and in the DNS Management page add in the cname the host: www and in the point to: your heroku url
https://www.youtube.com/watch?v=kKGSGT7mSnQ&t=9s
I believe this will solve your problem
Related
My api.<base-url> subdomain is not configured correctly. I purchased a domain through AWS and hooked it up to my static website running on Netlify. To do this, I set up Route53 to use Netlify's Name Servers. This works fine for the apex domain and https://<base-url> sends me to the static site.
Image of the Route53 hosted zone for this domain
I also have a node instance running on Heroku which I want to be hosted at api.<base-url>. Currently it is accessible by the heroku provided url (<project-name>.herokuapp.com)
I added a custom domain to Heroku for the api subdomain of my Netlify site api.<base-url>, the result of my heroku domains command is:
➜ heroku domains
=== <project-name> Heroku Domain
<project-name>.herokuapp.com
=== <project-name> Custom Domains
Domain Name DNS Record Type DNS Target
api.<base-url> CNAME fitted-lemon-gzwby8exkguturnmh2emy5l4.herokudns.com
And I created a CNAME record on Route53 that points to this Heroku DNS target.
This sort of works, running host api.<base-url> gives:
➜ host api.<base-url>
api.<base-url> has address 104.248.60.43
api.<base-url> is an alias for <project-name>.herokuapp.com.
api.<base-url> is an alias for <project-name>.herokuapp.com.
So it is aliased to my heroku app, but when I go to api.<base-url> directly I get a white page that says 'Not Found', looks like this is on Netlify's side not Heroku? But I'm not sure. I feel like I need to tell Netlify somehow that there is a custom subdomain at api.<base-url> but the only thing I can find in the docs is setting up Netlify's subdomains from other branches of the project, not when a subdomain is hosted elsewhere.
Setting api<base-url> as a Netlify custom domain just ended up routing all the traffic for api.<base-url> to the static netlify site at <base-url> instead of my Heroku app.
I made a few other attempts but nothing has worked so far, I am officially stuck on this. Thank you in advance!
Found it! Figures that it would click 30 minutes after posting.
I had a CNAME on Route53 but this was useless since I was using the Netlify DNS. You'll need to create a CNAME on Netlify that points to the host Heroku gives you.
So my heroku domains gave me the host I needed the CNAME to point to. I created a CNAME record on Netlify - which was not very obvious, I had to click into the badge 'Netlify DNS' in order to find the config.
I was able to create the right CNAME and then have it all work after that.
I have a small laravel website that I built for a company on heroku. They had the domain registered with godaddy, so I altered the cname and it seems to work fine when I go to www.example.com.
However, when I go to http://example.com, the naked domain of example.com still ends up at the godaddy error page for a parked domain.
In heroku, I added a custom domain as www.example.com and entered the DNS target I was given.
Do I need to do something different for the naked domain?
Yes, you need to add point DNS add on on heroku for your naked domain to work :
https://devcenter.heroku.com/articles/pointdns
I have an application where users get their own subdomain, like site1.mysite.example. I would like to allow users to register a custom domain that they can point to to their sub domain but I'm having trouble figuring how to configure Heroku and my DNS settings to allow this.
In my DNS settings for my domain I have a CNAME record setup like so:
Host = *
Value = sites.mysite.example
The value here is an app I have running which will translate the subdomain (site1.mysite.example) to figure out which site to load.
I have a CNAME for mysite.com which points to Heroku's DNS site:
Host = sites.mysite.example
Value = mysite.example.herokudns.com
On the domain I'm testing with I have a CNAME record setup like this:
Host = docs.othersite.example
Value = site1.mysite.example - this is the subdomain they get on my site
But for some reason this is not working. If I register site1.mysite.example as the custom domain in my application and I run dig site1.mysite.example I get the following:
;; ANSWER SECTION:
docs.othersite.example IN CNAME site1.mysite.example
site1.mysite.example IN CNAME sites.mysite.example
sites.mysite.example IN CNAME mysite.example.herokudns.com.
When I try docs.othersite.example in a browser I get Heroku's There's nothing here, yet. page. So it seems like Heroku is not loading up my application. I am guessing this is because I do not have docs.othersite.example registered as a domain in my Heroku application, but I do not want to have to register every custom domain. Also, I do not own these domains so I could not anyway.
What am I doing wrong here? Any help is much appreciated. I'm happy to post any more info someone needs or clarify anything.
Heroku does support wildcard domains, so in this case you could add *.othersite.example to your Heorku app's custom domains.
If you need to support different root domains (othersite2.example, othersite3.example) for each user, there's no easy way to support that. You'd need use Heroku's Platform API to programmatically manage custom domains.
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 .
I am using Media Temple to configure my DNS settings for a domain. I recently launched an application on Heroku and want to set a subdomain of my domain to be the CNAME for the Heroku application. The issue is the DNS editor places a period at the end of the Heroku domain name when I enter it as a CNAME, and Heroku shows an error that this is not a valid domain.
In my DNS settings, I have:
subdomain.domain.com CNAME appname.herokuapp.com
When I save this, it shows up in the settings as
subdomain.domain.com CNAME appname.herokuapp.com.
Any ideas on how to remove that trailing dot?
I ran into this problem the other day when setting up CloudFlare for my Heroku app. "I do not think it means what you think it means."
With Heroku, you have to add domains that your app will be accessible from, even if your managing DNS elsewhere. Here's there documentation for how to do it. Basically, you can do this from the terminal:
cd into your app's directory
heroku domains:add subdomain.domain.com to add the subdomain like you want.
Also, on mediatemple, I think you might need to put just the subdomain part instead of subdomain.domain.com, though it'll probably work either way. As shown on the knowledgebase article from launchrock on adding a CNAME with Media Temple:
"5. In the Name field, enter the part of the address you chose to use for your website with
LaunchRock. For example, if you chose signup.yoursite.com, enter signup in the Name field."