Google Hosted Site: Resolving a Naked Domain
Post date: Oct 19, 2010 6:37:21 PM
I appreciate that Google provides me all these convenient and easy to use tools to host my domain, and they do it all for free. However, it has always been agitating that users could not get to my website without typing the infamous dub, dub, dub at the front. Recently, I found a way to conquer this problem, and I thought others might want to do the same. Interestingly enough, I was able to accomplish this by using another free Google tool. Blogger!
A domain without a prefix of some kind like "www." or "mail." is referred to as a "naked domain". For example:
public subdomain = www.yourdomain.com
private subdomain = mail.yourdomain.com
naked domain = yourdomain.com
Many people, in haste or habit, will leave off the "www" at the beginning of a web address when typing into the browser location bar (as in bullet three above), and they expect to land on the www home page of the site. Most domains are configured to send you to www.yourdomain.com even when the www is left off. With Google domain hosting (the free version anyway), there is no out-of-box way to configure this option. Therefore, you're forced to use a hack. However, it just so happens that Blogger.com, Google's free blogging application, has the ability to resolve a naked domain. So, that is what I used to train my Google hosted domain to resolve logiclander.com.
Here are the steps you can take to accomplish this for your Google hosted domain:
Create an account at blogger.com (or, use an existing account)
Create a new blog with this account. Call it something simple like "nkdom" for naked domain or something else that is available. This is non-de-script, but the name is not important. This is not a blog that you will not direct anyone to or post to for that matter.
Create a CNAME entry at your domain registrar (i.e. godaddy.com or wherever you're Google DNS service is registered). Call it something like "nkdom" too, and point it to ghs.google.com (like your other CNAME aliases for all things hosted at google). Your domain registrar screens will vary, but your entries will look something like - Illustration A - below. NOTE: The name is not important, as no one will actually navigate here in the address bar. Also, the cname DOES NOT have to match the blog name created above, but it will NEED TO match the name in the next step.
Back at blogger.com: Navigate to Settings --> Publishing for your naked domain (nkdom) blog. On this form select the option to publish to a custom domain, then enter the fully qualified domain name using the CNAME that you created at your domain registrar above. For example, http://nkdom.yourdomain.com. Also on this screen, click to put a check in the "Redirect yourdomain.com to nkdom.yourdomain.com". IMPORTANT... This is the whole reason your here. This is the feature that Blogger.com offers to enable naked domain aliasing.
Now navigate to Layout --> Edit HTML for your naked domain (nkdom) blog. Use this form to add a <meta http-equiv="refresh" content="0;url="http://www.yourdomain.com"/> tag to the head of your blog template. As with all the examples here, remember to change references to "yourdomain" to your actual domain name.
Back at your domain registrar: You will need to create "A" records for one of more of the Google Apps IP addresses. I just entered all of them. NOTE: do not remove the wildcard entry that routes all of your named subdomains. In the end, you will have five-ish entries that apply to your Google hosting (* points to 216.21.239.197, and four blank entries that point to 216.239.32.21, 216.239.34.21, 216.239.36.21, 216.239.38.21). Again, your domain registrar screens will vary, but your entries will look something like - Illustration B - below.
Now, you play the waiting game. It can take several hours for your registrar to update it's DNS tables; however, I have generally seen this take affect within an hour or two.
Illustration A:
Illustration B:
After this takes affect, typing yourdomain.com (without the dub, dub, dub) in the browser location bar will get resolved to the Google IP. Then, Google will know that the domain belongs to a blog from Blogger.com, so it will reply with a 302 redirect to nkdom.yourdomain.com. Ultimately, this is simply using your naked domain blog as a soft redirect to your www.yourdomain.com.
If you've made it this far, you're probably asking... Why doesn't google just have that same "Redirect domainname.com to nkdom.yourdomain.com" checkbox in my Google Apps domain control panel?
Good question!
Enjoy... Hope this helps.