I have mydomain.com.au setup with a DNS provider. I have successfully pointed my DNS target through Heroku to my DNS provider. However, to do so, I had to use a CNAME record to do so. As such, the web app is now available at www.mydomain.com.au.
I am trying to redirect www.mydomain.com.au to mydomain.com.au instead. This seems to be quite challenging. As per this Heroku Guide, I need to use specific DNS providers that support ALIAS or ANAME records to do this. However, none of their DNS providers support domain transfer of .com.au
Does anyone have an alternative????
You can use Cloudflare DNS, where you can enable proxy and configure the website to redirect if the user visits www.mydomain.com.au.
Related
I have deployed an app on Heroku, and everything is going great when the app is being accessed from the herokuapp.com domain. I tried adding a custom domain and have followed the instructions from the documentation, but unfortunately, I encounter a DNS_PROBE_FINISHED_NXDOMAIN error when trying to access the app from my custom domain.
Some articles pointed out how Heroku requires the usage of ALIAS ANAME or FLATTENING records, which may not be available in DNS providers. I am using a local DNS provider where Name Server configuration is not directly accessible, and only the DNS provider admin can configure it on my request, so I am unable to check the CNAME Records and such (probably because I use .id domain, which I believe to have a somewhat specific configuration due to its affiliation with the country Indonesia, could be wrong though).
For my Name Server, because my DNS Provider requires at least two different name servers, I registered the domains for my Heroku app (from the Heroku settings dashboard > add domain and from the CLI) as follows:
my-domain.id
*.my-domain.id
www.my-domain.id
Is there anything I can do to fix this? Any help would be highly appreciated! Thank you!
EDIT:
I have just been informed by my DNS provider admin that the name servers I used, which I got from Heroku ([haiku].herokudns.com) does not have IP address. Is there anything I did wrong on the configuration?
As it turns out I managed to find my own mistake! It turns out that I provided the DNS Target as Name Server to my provider, which is totally not the same thing. What solved my problem was simply asking the provider to register a CNAME with the DNS target from Heroku as the value.
Be sure to provide the correct DNS Target for the domains as the DNS Target produced for registering root domains like your-domain.com will be different from the DNS Target produced for registering subdomains like www.your-domain.com or when using wildcard tag (*.your-domain.com). Also, note that Heroku doesn't recommend the usage of A Record for root domains, so be sure that your DNS Provider supports the record types needed as this Heroku article suggests.
Thank you #Ruurtjan Pul for getting in touch! Hope this helps!
I am having troubles with setting up custom domain for my heroku app.
here is my heroku app:
https://evening-beyond-1234.herokuapp.com/
and let's say it is my domain:
my-fake-domain.com
So I want my app being able at this domain.
I've added this domain to heroku app domains:
$ heroku domains
=== evening-beyond-1234 Heroku Domain
evening-beyond-1234.herokuapp.com
=== evening-beyond-1234 Custom Domains
Domain Name DNS Target
---------------- ---------------------------------
my-fake-domain.com evening-beyond-1234.herokuapp.com
And on the site where I've bought the domain I can change DNS, so I did this:
1) Type of DNS -> DNS from other hosting provider
2) 1st DNS server (*required) -> evening-beyond-1234.herokuapp.com
3) 2nd DNS server (*required) -> evening-beyond-1234.herokuapp.com
I put the same for the second DNS, because it is marked as required, so I need to specify two DNS.
It's been a few days after these changes and it does not work.
There is also another option for changing DNS: extended DNS editor.
I can specify CNAME entries and others there.
Any ideas what I am doing wrong?
I am completely new to this area, it should be just a silly mistake from my side %)
Your configuration is incorrect. What you are doing is that you are changing the name server of your domain, hence moving the delegation to Heroku.
However, Heroku is not an authoritative name server, hence you can't delegate your domain to them.
What you need to do is restore the delegation at your hosting provider and, instead, check the documentation of your hosting/DNS provider to learn how to create an A or CNAME record to point your domain to Heroku.
Also note that you will not be able to point your apex domain (hence my-fake-domain.com to Heroku unless you use one of these DNS providers that support a CNAME-like capability for the apex domain.
Regardless who you use, you can create a CNAME record to point www.my-fake-domain.com to evening-beyond-1234.herokuapp.com.
For my-fake-domain.com you either create an ALIAS/ANAME according to one of those provider documentation, or you redirect the domain to the www version.
Would like to learn how website works.
Purchased a domain name from bigrock domain registrar.
Am used to deploy applications to Heroku for my official websites.
But this is my personal site deployed to Heroku.
But how to connect my domain name to heroku ?
Heroku documentation is not clear to me.
I tried domain forwarding after playing with google search, but my site http://www.prithvibhargav.com/ is still giving me blank page.
Where as the heroku default website address still works
http://afternoon-cove-8287.herokuapp.com/
How to make my domain name to connect to heroku and work ?
There are so many terminoliges people use which is confusing
CName , A address, 301 redirect, domain forwarding
Which one to choose ?
You need to set your DNS to point to your heroku address. You should be able to go into the DNS settings in bigrock (where you registered the domain) and create CName record that will forward from your domain (http://www.prithvibhargav.com) to the heroku address (http://afternoon-cove-8287.herokuapp.com/)
I'm running my parse app on a naked domain. Parse is not making my life easy though.
At first I struggled to set it up because most DNS hosting services don't allow CNAMEs on the the root domain and Parse requires a CNAME.
Decided to try it out with CloudFlare's CNAME flattening and it ended up working by setting up the CNAME under [hostname key].example.com.
Parse wouldn't allow me to set it up without the hostname key because example.com was not a real CNAME (it's being translated to an A record under the wood by CloudFlare).
But I want to run my website under HTTPS so I registered a certificate that is valid for both "https:// example.com" and "https:// www.example.com".
Again Parse doesn't make it easy. First it didn't accept my certificate because the hostname wouldn't match. I thought that maybe it was trying to compare it with the subdomain of the cert (www.example.com) and that wouldn't match with my app domain (example.com).
I created another CNAME at [hostname key].www.example.com poiting to my parseapp.com url (didn't want to change www.domain.com because it's already poiting to another service that redirects to domain.com), changed my app hostname to www.example.com and it finally accepted my certificate! Yeahhh!
Changed the app hostname back to example.com and tried to access it in the browser, but it takes forever to load and ends failing.
If I change my app to run on "https:// www.example.com" (secure site with with the www subdomain) then it works fine.
So I'm able to run my app in http://example.com (not secure, without www) or "https:// www.example.com" (secure with www).
Why is it that Parse makes it so difficult to run an app on the root domain?
Is there something that I need to do to be able to run a secure app in the root domain?
Most of web services nowadays are designed around the idea of CNAMEs: they provide you a CNAME and you should alias your hostname to that name.
However, as you noted, the CNAME has certain limitations imposed by the DNS protocol RFC and it can't be used to map an apex domain.
Some DNS companies, such as DNSimple or DNS Made Easy, provides a CNAME-like record type that can be used to map the root domain to an hostname provided by a cloud service. Using these services will also make it easier to configure an SSL certificate.
Speaking of SSL certificates, beware that when you purchase a single-name certificate for example.com or www.example.com, it is only valid for that specific hostname. Most certificate authorities will also include the corresponding apex domain if you purchase www.example.com, but you need to check with your SSL certificate provider.
Last but not least, the ability to redirect HTTP to HTTPS traffic really depends on your service provider, in this case parse.com. Unfortunately, it's not uncommon for these services to not force HTTPS. Heroku is currently doing the same, they don't force HTTP to HTTPS when you enable HTTPS.
You should check with them if there is a way to apply such redirect, as the only way is to apply it either at server level or app level. You can't apply the redirect, for example, at DNS level.
I already added a custom domain to my Heroku app and it works with www.domain.com.
I need to know how to set up the domain without www to resolve to the app, too.
Here are my current DNS settings:
$TTL 86400
# IN SOA ns1.first-ns.de. postmaster.robot.first-ns.de. (
2013041500 ; serial
14400 ; refresh
1800 ; retry
604800 ; expire
86400 ) ; minimum
# IN NS robotns3.second-ns.com.
# IN NS robotns2.second-ns.de.
# IN NS ns1.first-ns.de.
# IN A 88.198.38.XXX
localhost IN A 127.0.0.1
mail IN A 88.198.38.XXX
ftp IN CNAME www
imap IN CNAME www
loopback IN CNAME localhost
pop IN CNAME www
relay IN CNAME www
smtp IN CNAME www
www IN CNAME appname.herokuapp.com.
# IN MX 10 mail
What are the correct settings to use so that both example.com and www.example.com would point correctly to my Heroku app?
(Note: root, base, apex domains are all the same thing. Using interchangeably for google-foo.)
Traditionally, to point your apex domain you'd use an A record pointing to your server's IP. This solution doesn't scale and isn't viable for a cloud platform like Heroku, where multiple and frequently changing backends are responsible for responding to requests.
For subdomains (like www.example.com) you can use CNAME records pointing to your-app-name.herokuapp.com. From there on, Heroku manages the dynamic A records behind your-app-name.herokuapp.com so that they're always up-to-date. Unfortunately, the DNS specification does not allow CNAME records on the zone apex (the base domain). (For example, MX records would break as the CNAME would be followed to its target first.)
Back to root domains, the simple and generic solution is to not use them at all. As a fallback measure, some DNS providers offer to setup an HTTP redirect for you. In that case, set it up so that example.com is an HTTP redirect to www.example.com.
Some DNS providers have come forward with custom solutions that allow CNAME-like behavior on the zone apex. To my knowledge, we have DNSimple's ALIAS record and DNS Made Easy's ANAME record; both behave similarly.
Using those, you could setup your records as (using zonefile notation, even tho you'll probably do this on their web user interface):
# IN ALIAS your-app-name.herokuapp.com.
www IN CNAME your-app-name.herokuapp.com.
Remember # here is a shorthand for the root domain (example.com). Also mind you that the trailing dots are important, both in zonefiles, and some web user interfaces.
See also:
Doing DNS right with Heroku
Avoiding Naked Domains and DNS A-records
Remarks:
Amazon's Route 53 also has an ALIAS record type, but it's somewhat limited, in that it only works to point within AWS. At the moment I would not recommend using this for a Heroku setup.
Some people confuse DNS providers with domain name registrars, as there's a bit of overlap with companies offering both. Mind you that to switch your DNS over to one of the aforementioned providers, you only need to update your nameserver records with your current domain registrar. You do not need to transfer your domain registration.
To point your apex/root/naked domain at a Heroku-hosted application, you'll need to use a DNS provider who supports CNAME-like records (often referred to as ALIAS or ANAME records). Currently Heroku recommends:
ALIAS at DNSimple
ANAME at DNS Made Easy
ANAME at easyDNS
ALIAS at PointDNS
CNAME at CloudFlare
Whichever of those you choose, your record will look like the following:
Record: ALIAS or ANAME
Name: empty or #
Target: example.com.herokudns.com.
That's all you need.
However, it's not good for SEO to have both the www version and non-www version resolve. One should point to the other as the canonical URL. How you decide to do that depends on if you're using HTTPS or not. And if you're not, you probably should be as Heroku now handles SSL certificates for you automatically and for free for all applications running on paid dynos.
If you're not using HTTPS, you can just set up a 301 Redirect record with most DNS providers pointing name www to http://example.com.
If you are using HTTPS, you'll most likely need to handle the redirection at the application level. If you want to know why, check out these short and long explanations but basically since your DNS provider or other URL forwarding service doesn't have, and shouldn't have, your SSL certificate and private key, they can't respond to HTTPS requests for your domain.
To handle the redirects at the application level, you'll need to:
Add both your apex and www host names to the Heroku application (heroku domains:add example.com and heroku domains:add www.example.com)
Set up your SSL certificates
Point your apex domain record at Heroku using an ALIAS or ANAME record as described above
Add a CNAME record with name www pointing to www.example.com.herokudns.com.
And then in your application, 301 redirect any www requests to the non-www URL (here's an example of how to do it in Django)
Also in your application, you should probably redirect any HTTP requests to HTTPS (for example, in Django set SECURE_SSL_REDIRECT to True)
Check out this post from DNSimple for more.
I am now using Google Apps (for Email) and Heroku as web server. I am using Google Apps 301 Permanent Redirect feature to redirect the naked domain to WWW.your_domain.com
You can find the step-by-step instructions here
https://stackoverflow.com/a/20115583/1440255
You are not allowed to have a CNAME record for the domain, as the CNAME is an aliasing feature that covers all data types (regardless of whether the client looks for MX, NS or SOA records). CNAMEs also always refer to a new name, not an ip-address, so there are actually two errors in the single line
# IN CNAME 88.198.38.XXX
Changing that CNAME to an A record should make it work, provided the ip-address you use is the correct one for your Heroku app.
The only correct way in DNS to make a simple domain.com name work in the browser, is to point the domain to an IP-adress with an A record.