Naked/Root domain with heroku, Squarespace or other SaaS service

We wanna use root domain!

When you are using heroku, Squarespace or other SaaS based service, you may want to use your domain instead of the domain you got from them.

You get something like this:
yourapp.herokuapp.com

but you want to make it like this:
www.cooldomain.com

also you want to user root/naked domain:
cooldomain.com
(this is called root domain or naked domain)


To achieve this, you need to change DNS setting as recommended in documentations like Custom Domains.

There are two ways.

  1. CNAME functionality at the apex
  2. Subdomain redirection   I would say the second one is easier because not so many domain register provide apex function at this moment or sometimes you may have no choice about DNS server.

Subdomain redirection

For subdomain redirection, you set CNAME and domain forwarding. If your DNS server provides domain forwarding function, you can simply follow this heroku instruction. If you are using Amazon Route 53, just follow this.
However, if your DNS server DOES NOT provide domain forwarding function, is there no way to use naked/root domain?

wwwizer

This is where wwwizer.com comes in. They provides naked domain redirect for free. The only thing you need to do is just pointing your naked/root domain to "174.129.25.170" then it'll be redirected to the subdomain with "www" in front.

So your domain setting is someting like this:
domain2

A record:
174.129.25.170

CNAME:
Provided domain from Saas like yourapp.herokuapp.com, ext.swuarespace.com ...
 

I didn't use wwwizer since I'm used to Amazon Route 53, but when I don't have fully control about a project, wwwizer turned out so handy for me.
That's it. Though, I think it's a rare case that you can't use domain forwarding function.

何かありましたらコメントをどうぞ

comments powered by Disqus

人気の記事

950 Points チリ出身のギタリストが弾くドラゴンボールZがむちゃくちゃかっこいい…
774 Points Wordpress + Heroku + PostgreSQL + Amazon S3 = ¥0 / 無料でサイト運営
700 Points Rubyのチートシート 変数 / クラス / モジュール
524 Points Rubyのチートシート / アクティブサポート
451 Points 紙のデザイナーがウェブ開発できるようになるまでに必要なこと
435 Points Rails / Google Analyticsのデータを使って分析や管理画面のためのグラフをつくる
323 Points RailsとHerokuでノーティフィケーションをプッシュする / PusherとTurbolinksの兼ね合い
222 Points Rails / RSpec テスト書いたことない メンドクサイ(n´Д`)という時のチートシート
193 Points Rails / Ajaxを使って画面遷移しない一時保存機能をつける
193 Points Protractorでスクレイピングしてみた