Why is my heroku hosted bluehost domain www.rememberlenny.com different from rememberlenny.com - ruby-on-rails

I have uploaded a rails application to Heroku. I have a domain hosted with bluehost. I have assigned the domain to bluehost and set the CNAME properties of the WWW record point to the herokuapps URL. I have the # A-record pointing to the bluehost shared Host ip address. Because I dont have a HerokuApps unique IP address, I havn't assigned an A-Record.
Currently when I go to the www.rememberlenny.com and the rememberlenny.com, they are displaying two seperate sites.
Today I changed the domain record of the CNAME on WWW to the heroku app. The non-WWW domain propagates to the old shared hosting location. I want both the www.rememberlenny.com and rememberlenny.com to show the same place.
Do I wait for the DNS change to propogate, or is there some setting that I am not changing the host records?

Your ttl is set to 14400 or 4 hours. It's always a good idea to set that very low BEFORE you need to change the DNS records.
Here is info on heroku dns settings: https://devcenter.heroku.com/articles/custom-domains
Heroku does NOT support A records on the bare domains name (without the www), so you need to change that to a url redirect or forward record and remove the A record on the bare domain.

I have tried configuring Heroku custom domains using Bluehost and Hostmonster in the past (currently use Hostmonster), and in their CPanel DNS Zone Editor the TTL (time to live) for any DNS changes is 14400, or 4 hours.
I tried to lower this setting, and they don't permit it. There's no way around it - you have to accept their default TTL of 4 hours. I'm really hoping my change works, because the idea of a 4 hour trial and error cycle sounds dreadful.
Anyway, hope this answer sheds some light on what has been a hellish process - trying to get Heroku to play nicely with Hostmonster's DNS settings.
D.

Related

How to do DNS Set up / cname flattening with heroku and Godaddy

I have application deployed in Heroku with Godaddy domain.
After trying several methods done dns setup.
Add CNAME www with value DNS target provided by heroku.
This is working fine for domain with www. But I like to open domain without www(naked domain). which is not working currently.
What I have already tried and nothing worked for me.
Add CNAME with name(naked domain) and value(heroku app url)
(a) Add a Domain with naked domain name(domain name without www)
(b) Add CNAME with name(naked domain) and value(heroku app DNS Target
value from(a))
Add Forwarding https:// with www.domain-name
Then tried configure DNS setup in cloudflare there everything problems got resolved, But there website's speed got slow and even some JS was not working. Tried several code changes and deployment, Nothing worked so finally back to GoDaddy for DNS Setup.
Somewhere got to know that CloudFlare provide CName flattening which GoDaddy not. Due to CName Flattering Redirection works fine with CloudFlare.
Please suggest me steps to resolve this. domain URL
Got response from Heroku team.
Redirecting from root domain [http://mysite.in/] to sub domain [http://www.mysite.in/] can be done at application level or on your DNS provider [GoDaddy] settings. Heroku or any other similar platforms won't have such an option.
Heroku recommends you to point the root domain to its DNS target with an ALIAS/ANAME record type. Unfortunately, Godaddy doesn't give that option. The root domain's DNS target can be an IP address as well, but the IP addresses of your application on Heroku keeps changing, at least once a day, so you can't use that as DNS target. We have an article on how you should set up the domains for a Heroku app, please give it a read https://devcenter.heroku.com/articles/custom-domains and let me know if you have any question there.
So the options you are left with is to make use of an add-on like Quotaguard which will give you a static IP address against your Heroku application, this IP can be used as DNS targets or change the DNS provider, we have a list of DNS providers which support ALIAS/ANAME record type.

1&1 domain pointing to Heroku

I am aware that there have been a few discussions on this one but none have given a definitive answer. I am hoping this will help me and others.
Problem:
I have a domain name (www.xyz.com) registered with 1&1.
I want users to be able to type this in and be shown my website. A Heroku web app.
I want the domain name (www.xyz.com) to be displayed. Not any subdomain url or the heroku app URL.
I do not want the set-up do be anything that will have a detrimental impact on SEO.
Note: I have just got off the phone with 1&1 and they have said that my only options are to do a frame redirect or a http forward. Neither of these meet the above requirements.
Additionally, other posts have suggested finding out what the Heroku IP address is and using this but Heroku recommend against this as they might change it without notice.
Please could I ask that any one kind enough to respond spells things out a little. Anyone having problems with redirects is likely to be new to this.
Thanks.
never used the 1&1 services, but solving your problem is pretty straightforward.
Take the following steps:
Add you domain to heroku. heroku domains:add www.xyz.com . If you have more than 1 app in your heroku account, remember to pass the --app flag
Now you should have something like myherokuapp.herokuapp.com where myherokuapp is the name of your app on heroku
Go to 1&1 and create a CNAME record pointing to myherokuapp.herokuapp.com
I found this video to be helpful - https://www.youtube.com/watch?v=ZLVBBAnrrL4
Basically, as noted by #Kevin Lawrence above, you use the 'www' subdomain.
I've never used 1&1 but my DNS provider (dreamhost) does not allow CNAMEs on the main domain name either. It does however allow me to create a CNAME for the www subdomain which was good enough in my case.
I did this:
heroku domains:add www.mydomain.com
create a CNAME record pointing to mydomain.herokuapp.com
Have mydomain.com redirect to www.mydomain.com
It's not exactly what I wanted (or what you want) but it works.
What worked for me was to user Namecheap.com's FreeDNS service that provides free automatic redirect for your TLD and subdomains directly to Heroku, while keeping your domain visible:
example.com and www.example.com now point to exampleapp.herokuapp.com
I had to have a live chat with Namecheap's support to complete the domain verification process, but they answered really fast! Love to namecheap, 1and1 is really crappy, moving my domains away soon. :)
I got this to work properly! No need for CNAME at all. Create a A record in heroku like in this link - creating a custom room domain - provided by heroku (of course, change example.com to your root domain):
heroku domains:add example.com
Here, example.com is the ROOT domain. Once you get an A record, execute the following command
heroku domains:wait example.com
Now verify your domain has been provisioned:
heroku domains -a [your custom heroku app name]
And you get this:
=== [your custom app name] Custom Domains
Domain Name DNS Record Type DNS Target
example.com ALIAS or ANAME elliptical-blueberry-1euo3460fyrtc8zdgulv0f7o.herokudns.com
Next, get the IPv4 IP address of elliptical-blueberry-1euo3460fyrtc8zdgulv0f7o.herokudns.com I got it by using a lookup service.
Updating 1 and 1
Go to 1and1.
Click the DNS tab for your custom domain e.g. example.com
Delete the existing A record
Create a new A record and enter in the # symbol if it asks you, or else I think it is the default AND enter in the IPv4 address
For testing this out, make the TTL 1 min until it's stable
Give it time to propagate. Could be a few minutes to 24 hours.

1and1.com to Heroku

Edit: Just to be clear, actually I only want to use a different webserver, not mail server. It has to stay the same.
I've got a 1and1 plan including webspace and email service. As 1and1 doesn't support Ruby, I created my website at Heroku.
I'm now trying to point my www.example.de url to my example.herokuapp.com domain. As this is the very first time I'm doing this, please alert me if I'm missing something important.
The website uses the 1and1 mail server. I found out that, due to that fact, I can't go the cname way but need a A Record (or ANAME Record?). I already pointed heroku to the right urls and now need to set up 1and1 and a dns service.
I registered at dnsmadeeasy.com and created an ANAME Record:
Name: [left blank]
FQDN or IP: myapp.herokuapp.com
TTL: 1800 (I've got no idea what that is)
After creating that, dnsmadeeasy.com shows me several "System NS Records" which look like nameservers?
ns0.dnsmadeeasy.com
upto
ns4.dnsmadeeasy.com
As far as I understand I now have to enter the nameservers above at 1and1.
My question now is, does this disable the by default working mail server connection? If yes, how would I point back to it from dnsmadeeasy.com? Or is there a better way to do this?
It seems the easy way to do it now is with Point DNS. They have a free developer plan: https://devcenter.heroku.com/articles/pointdns
Enter the Point DNS servers into the 1and1 Domain Manager.
The problem was solved by just adding a A-record at 1and1 pointing at Heroku. No nameservers or any extra service needed.
Here is a more detailed update:
First you have to go to the Heroku app settings. There you can add domains for your app, like www.mydomain.com.
Then you use a service to get the IP address of the server where your Heroku app instance is running. (Just get the IP address of your instance of yourapp#herokuapp.com.) Then you add this IP address as a A-record to the 1and1 app settings. Now you have to wait for the settings to propagate over the DNS servers.
Basically you point your 1and1 app to the server on which your Heroku app runs and inform your Heroku app that there probably is some app trying to reach through to it, which has a specific address, like www.mydomain.com. That's how they find each other.

What is the nameserver to use for heroku?

I am hosting my app at heroku, my domain is with godaddy. How to point my domain to my heroku app?
Shall I change NameServer 1 and NameServer 2 to myApp.herokuapp.com and myApp.herokuapp.com?
I have followed instructions at heroku, but, I want to make sure that I am on the right way.
You don't change the nameservers, Heroku is not a DNS provider. You leave the domain management wherever you are comfortable with it and edit the records to point at your app on Heroku.
It's detailed more at https://devcenter.heroku.com/articles/custom-domains#dns-setup but in summary, if you have a domain foobah.com registered with GoDaddy with would use their control panel (maybe Advanced control panel) to edit the DNS records to point at Heroku. You need to have a CNAME record for www.foobah.com with it's value set to myapp.herokuapp.com. You may find you already have an A record setup for you when you registered the domain or an existing site, you should delete this. You also then need to add the custom domain www.foobah.com to your application on Heroku.

Rails, Heroku and Subdomains. Is my special case scenario feasible?

Here is my scenario:
I have an application that will have to support multiple clients. Each client will be given a subdomain for there service. We will also have a brochure website that doesn't have the application, its just a website about the product and how potential clients can setup an account with us.
Given:
www.mycoolsite.com would point to a brochure app on Heroku.
client1.mycoolsite.com, client2.mycoolsite.com and client3.mycoolsite.com would all point to the same SaaS application that could tell the difference between each request and I should be able to handle so they only see their date (i.e. setting a global client_id or something like that)
How do I go about doing this? I haven't done a lot with DNS so I'm pretty clueless about where to start with this.
Thanks.
No sweat. We do that now, at Heroku. We happen to use Godaddy for the domain registrar, but any DNS control panel will let you do the same thing.
The other explanations I read here are a little general, here are the specifics...
The explanation at heroku is very good, at : http://docs.heroku.com/custom-domains
(there's even a very good screencast shows step by step)
the key thing is if your ROOT domain (mycoolsite.com) is at Heroku you want to create THREE "A" records, because they do some fault-tolerant crossover magic. So you'd have an A record for
75.101.163.44
75.101.145.87
174.129.212.2
Now for each subdomain you create a CNAME record
www -> proxy.heroku.com
client1 -> proxy.heroku.com
client2 -> proxy.heroku.com
client3 -> proxy.heroku.com
NOW on the HEROKu side, you have two apps right? The 'brochure app' and the saas app.
Login, and for each app go to Resources -> Addon -> Get More Addons ->Custom Domains (free)
for the brochure app, add ONE domain: www.mycoolsite.com
for the saas app, add each of the clients, eg:
client1.mycoolsite.com
client2.mycoolsite.com
client3.mycoolsite.com
That's it. works like a champ. Have fun.
What you're trying to do is very feasible, and quite easy to do.
You're going to need a combination of A and CNAME records. Simply put, A records map host names to IP addresses, and CNAME records act as aliases for A records.
Let's assume that your SaaS app is hosted at 10.0.0.1 and your Heroku app is at 192.168.0.1, and that you want www.mycoolsite.com and mycoolsite.com to point at the same IP.
(Note: I've never hosted anything at Heroku, so configuring DNS that may be slightly different)
First thing you'll need is an A record for the domain itself. (I've used BIND Zone File Syntax here - hopefully your DNS provider has a much simpler administration system.)
mycoolsite.com. A 192.168.0.1 ; heroku
www CNAME mycoolsite.com ; also heroku
These two records tell us that mycoolsite.com should point at Heroku's IP address, and that www.mycoolsite.com is an alternate name for mycoolsite.com, which will also resolve to Heroku's IP address.
Now, let's set up the DNS for your SaaS site. You could set up an A record for each sub-domain, but if you move servers, you'll have a lot of IP addresses to update. The simplest option is to configure one A record, then point your app's sub-domains at it:
sassapp A 10.0.0.1 ; saas app server canonical name
client1 CNAME sassapp ; alias
client2 CNAME sassapp ; alias
client3 CNAME sassapp ; alias
You can then add as many CNAMEs as you need.
I don't see this being an issue. Rails has had support for subdomains like that in the past with help from gems like subdomain_fu. In Rails 3, subdomain support is actually built in and covered by Ryan Bates http://railscasts.com/episodes/221-subdomains-in-rails-3. Take a look at that screencast for a good direction of where to start.
I believe you'll need the custom domains add-on for Heroku http://docs.heroku.com/custom-domains.
This won't be a problem. For DNS set up an A record for mycoolsite.com pointing to the server where you want your application. Set up an A record for www.mycoolsite.com that is configured for heroku. Now you will also want to redirect traffic that comes in on mycoolsite.com without www and redirect to www.mycoolsite.com, this will keep your top-level domain serving up your brochure app. Once requests are getting to your application you can follow the tutorial that raidfive linked to that will help you through handling subdomains inside of your application.

Resources