Tuesday, May 06, 2008

Google Custom Domains - The Two Step Domain Referral

Google Custom Domains provide an elegantly simple, yet robust, ability for us to publish our blogs to a Google server, and still address them using a non-BlogSpot URL.

By publishing our blogs to a Google server, we can enjoy the versatility of the dynamic HTML used in a Layouts template. By addressing our blogs using a non-BlogSpot URL, we can enjoy the personal identity of having our own domain.

And with all of this, our BlogSpot addresses continue to work, letting people and processes like search engine spiders continue to find our blogs in BlogSpot. We enjoy having the group identity of BlogSpot, when convenient.

Setting up a custom domain is deceptively simple.

(Update, 2014): Unfortunately, "Buy a Domain" is no longer a Blogger feature. Right now, all domains must be purchased, directly from a registrar.

Just use the "Buy A Domain For Your Blog" wizard, and register the domain of your choice (subject to availability). The longest part of that process is providing your credit card number, and having the payment verified. A successful registration consists of two steps
  • What domain name would you like?
  • Congratulations! You now own "mydomain.com"!


All things going perfectly, with you using "Buy A Domain", you're done. Get to work letting your friends know about your new address. And after the transition period, and if you use a Google Sitemap, update your site map.

If you used "Buy A Domain" and ran into problems, you'll be using the DNS hosts wizard, and the Blogger "Advanced Settings" wizard. In some cases, you'll use "Advanced Settings" intentionally. Now, you need to appreciate the details.

Many bloggers like their blog to be accessible, using 2 different addresses.
  1. By the primary domain, as in "mydomain.com".
  2. By a secondary alias, generally "www.mydomain.com". Alternatively, maybe as "blog.mydomain.com".


Either of these can be the Primary URL. The other, if circumstances permit, can be a Secondary URL.

Please, do not confuse the terms used here.
  • The term pair "primary domain / secondary alias" refer to DNS names for a web site.
    • The address "mydomain.com" is the primary domain (aka "domain root" / "naked domain").
    • The address "www.mydomain.com" can be a secondary alias for "mydomain.com".
  • The term pair "primary URL" / "secondary URL" refers to how YOU want your blog to be accessed.
    • If you publish your blog to "www.mydomain.com", that's the primary URL.
    • You can then use "mydomain.com" as the secondary URL.
In some cases, you might use "blog.mydomain.com" instead of "www.mydomain.com". That's your choice.

Note that the "primary domain" will always be one of the two addresses ("primary URL" / "secondary URL"). You cannot have "blog.mydomain.com" and "www.mydomain.com" as the primary URL / secondary URL pairs. Nor, can you have "www.mydomain.com" / "www.myotherdomain.com", without quite a bit more work.

To make either address ("primary URL" or "secondary URL") operational, you'll need 2 settings.
  1. A DNS entry, pointing to Blogger (generally, but not always, to "ghs.google.com").
  2. A Blogger entry, pointing to the blog.
The Buy A Domain wizard sets up both automatically, and not everybody appreciates the complexity of each one. Nor does everyone appreciate the structure of the "CNAME" referral definition.

The Primary URL
The primary URL is how the blog is addressed within itself, and it's the address displayed in the browser address window, when the blog is being viewed. When you look at the URL of the blog, do you see "http://www.mydomain.com", or simply "http://mydomain.com"? That's not always a personal choice - it may be a practical choice, and may involve several factors.

1. The Primary URL - The DNS Entry
Properly setting up the primary URL, in a custom domain, requires a "CNAME" referral. This is the first step, and is an occasional cause for confusion. If you wish for the primary URL for your blog to be the primary domain, "mydomain.com", you have to have your domain hosted by a registrar that supports "CNAME" referral for the primary domain. The DNS entry for the primary URL is the first, and the essential, component for all succeeding components.

If the DNS hosts supports use of a "CNAME" referral for the primary domain, you may elect to setup a DNS entry
mydomain.com. 3600 IN CNAME ghs.google.com.
If not, you make the primary URL to be a secondary alias.
www.mydomain.com. 3600 IN CNAME ghs.google.com.
or maybe
blog.mydomain.com. 3600 IN CNAME ghs.google.com.


If you purchased the domain through Blogger, using the "Buy A Domain" wizard, the primary URL is the "www" alias, and your blog is now "In Transition". If you purchased the domain directly from your domain registrar, you have to use the DNS wizard provided by your registrar. If the latter, you add a "CNAME" referral to "ghs.google.com" - there is no substitute for this setting, if you want a properly functional and reliable custom domain.

And remember that Step 1 is the first step. Neither Step 2, Step 3, nor Step 4 can be done until Step 1 has been done.

2. The Primary URL - The Blogger Entry
Until you setup the Primary URL within Blogger, you do not have a working custom domain. When you browse to a custom domain that has Primary URL DNS pointing to Blogger, but no Primary URL setup in Blogger, you'll see the well known
The site you have requested could not be found. (404)


After the DNS entry for the primary URL is functional (and that can be "24 to 48 hours" after you setup the entry itself), you have a DNS entry pointing to "ghs.google.com". Now, Blogger needs an entry in "ghs.google.com", pointing to the blog. And, the blog needs the proper links within itself, pointing to its various components.

If you were publishing your blog in BlogSpot, you would use Settings - Publishing, and simply enter the desired blog name. If you're publishing your blog to a custom domain, and you used the "Buy A Domain" wizard, do nothing - this will be done for you after the "72 hour" transition period. If you're using the "Advanced Settings" wizard, you have hopefully waited for the "24 to 48 hour" transition period, and your DNS entries are now active.

Now, you publish the blog to the domain, such as Step 4 of the Domain Republishing process. Before publishing the blog to the domain, you must add the domain ownership verification "CNAME", based on instruction provided in the Publishing - "Advanced settings" wizard.

The Blogger entry for the primary URL is the most complex portion of the custom domain setup. After you designate the primary URL for the blog, several essential steps are taken by the Blogger publishing process.
  1. All internal blog links, such as the blog feed URLs, and all links from any part of the blog to the others, are converted to include the primary URL.
  2. A "301 Moved Permanently" redirect is setup for the original BlogSpot URL, pointing to the primary URL.
  3. An entry in "ghs.google.com" is added, pointing to the blog.
And your primary URL is now operational.

Remember that Step 2 is the second step. Step 4 cannot be done until Step 2 is done. Until you define the Primary URL in Blogger, you cannot select a possible secondary URL.

The Secondary URL
The secondary URL is any alias used, by your readers, to view the blog. If the primary URL was the primary domain, you might (historically) make the "www" alias act like the primary domain, and also direct your readers to the blog. Alternatively, if the primary URL was the "blog" or "www" alias, you could elect to have the secondary URL be the primary domain.

If you purchased the domain through Blogger, using the "Buy A Domain" wizard, the secondary URL becomes the primary domain, because of settings in Google Apps.

3. The Secondary URL - The DNS Entry

If you decide to use a secondary URL for your blog, you have a number of choices. You can redirect the traffic using the secondary URL at the DNS server, or at the Google server. If you redirect the traffic at the DNS server to the primary URL, you won't have to do anything further with Blogger. If you redirect the secondary URL traffic directly to Google, then you'll need the Redirect selection in Blogger to redirect the traffic to the primary URL, then to the blog.

The most obvious DNS setting for the secondary URL is a second "CNAME" referral to "ghs.google.com". If your primary URL was "mydomain.com", you'll have
www.mydomain.com. 3600 IN CNAME ghs.google.com.
Alternatively, if the primary URL was the "blog", "www", or any other secondary alias, and (again) if the DNS host will permit, you could have
mydomain.com. 3600 IN CNAME ghs.google.com.
In either case, you will then need the Blogger redirect setting for the secondary URL.

Some people have chosen to redirect the secondary URL at the DNS server, either using a "301 Moved Permanently", or a "CNAME" referral to the primary URL
www.mydomain.com. 3600 IN CNAME mydomain.com.
or
mydomain.com. 3600 IN CNAME www.mydomain.com.
The latter, again, is possible only with support of the DNS host. In either case, you won't require a Redirect at the Blogger end.

4. The Secondary URL - The Blogger Entry
Finally, if you setup a "CNAME" referral at the DNS server, redirecting secondary URL traffic directly to "ghs.google.com", you'll need a corresponding "Redirect" setting using the Blogger "Advanced Settings" wizard.

If your primary URL was the primary domain, you could have your secondary URL be the "www" alias.
www.mydomain.com. 3600 IN CNAME ghs.google.com.
In this case, in "Advanced Settings", you'll have the optional selection
Redirect www.mydomain.com to mydomain.com.


Alternatively, if your primary URL was the "blog" or "www" alias, you could have the secondary URL be the primary domain.
mydomain.com. 3600 IN CNAME ghs.google.com.
In this case, in "Advanced Settings", you'll have the optional selection
Redirect mydomain.com to blog.mydomain.com.
or
Redirect mydomain.com to www.mydomain.com.


Now, the above setup implies a new domain, and most of the above is from using the "Advanced Settings" and / or "Buy A Domain" wizards. So, what if you already have a domain, maybe with a non-Blogger web site and email? Well, then you use a Google Apps based setup, which is essentially the above plus a small extra effort. For more information about the DNS configuration process, see Your Blog, Custom Domains, And Righteous Solutions.

>> Top



Reblog this post [with Zemanta]

3 comments:

ADMIN said...

Nice post.
I am having trouble setting up blogger with a custom domain. I bought the domain in July last year. I had set it up on url forward to point to my blog till now.
My ISP is Net4.in. It does provide a CNAME Change option but the option is not clickable.
However, I have added a subdomain (www) and set its cname(strangely subdomains have a cname option) to ghs.google.com
Since I have set blogger to www.mysite.com these settings should work right?
I had a better time configuring my free .co.cc domain

Chuck said...

Admin,

I think that this conversation would be better carried out in GBH: Something Is Broken.

Exclusive Ave said...

man, you just don't know how many times in the last 9 days I thought I had did this right...your explanations are superb...hit me up and I'll put a button from your site on mine, thanks to you I'm, at ExclusiveAve.com....