Tuesday, November 20, 2007

The Vagaries Of Publishing Your Blog To A Custom Domain

Since the Google Custom Domain product was made available to eager bloggers, there has been a well known limitation - the inability to get both "www.mydomain.com" and "mydomain.com" to redirect to the same Blog*Spot blog. I've been writing about this limitation since March 2007, a couple months after Custom Domains was launched.

That limitation was resolved in October, 2007.

But the ability to make "mydomain.com" == "www.mydomain.com" brought more uncertainty. Not all DNS Hosts support "CNAME" referral, of both the primary domain ("mydomain.com") and a subdomain ("www.mydomain.com"). Yet that referral is essential to the success of custom domain use.

When you setup your domain, the domain setup wizard (provided by your DNS host) should provide you with two lists - "A" and "CNAME". All direct references ("Hosts") go into the "A" list, and all others ("Aliases") into the "CNAME" list. The latter includes entries like "ftp", "mail", "pop", and all of the miscellaneous services which your DNS host might provide for you.

If you add a "CNAME" record for the "www" alias, for your domain "mydomain.com"", addressed to "ghs.google.com", you end up with a record shown as
www.mydomain.com. CNAME ghs.google.com.

If your DNS host allows you to do a "CNAME" referral to your primary domain "mydomain.com", it may be done in 1 of 4 ways
  1. The alias specified as ".", addressed to "ghs.google.com".
  2. The alias specified as "@", addressed to "ghs.google.com".
  3. The alias specified as "www", addressed to "ghs.google.com", as the first entry in the "CNAME" list, and with no entries in the "A" list.
  4. The alias specified as "mydomain.com", addressed to "ghs.google.com". This may, or may not, require deletion of any "A" list entries (similar to #3).
The correct procedure for your DNS host you must find out from instruction provided by your host, or from experimentation. If the latter, I suggest that you try 1 - 4 in sequence, carefully testing after each attempt.

It's also possible that a server based "301 Redirect", properly setup, will substitute for the primary domain "CNAME", though it will require a "CNAME" referral for the "www" alias (or another of your choice). We're unsure how to diagnose a "301 Redirect", per the examples below.

But wait. There's more.

Note: In the examples below, I'm using the "ping" command to diagnose my example domain, mydomain.com. You may check your specific domain, similarly.

Having explicitly setup
www.mydomain.com. CNAME ghs.google.com.
and having implicitly or explicitly setup an equivalent
mydomain.com. CNAME ghs.google.com.
you would hope to test both aliases successfully.

C:\>ping mydomain.com

Pinging ghs.l.google.com [66.249.81.121] with 32 bytes of data:

Reply from 66.249.81.121: bytes=32 time=74ms TTL=246
Reply from 66.249.81.121: bytes=32 time=71ms TTL=246
Reply from 66.249.81.121: bytes=32 time=73ms TTL=246
Reply from 66.249.81.121: bytes=32 time=75ms TTL=246

Ping statistics for 66.249.81.121:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 71ms, Maximum = 75ms, Average = 73ms

C:\>ping www.mydomain.com

Pinging ghs.l.google.com [66.249.81.121] with 32 bytes of data:

Reply from 66.249.81.121: bytes=32 time=74ms TTL=246
Reply from 66.249.81.121: bytes=32 time=71ms TTL=246
Reply from 66.249.81.121: bytes=32 time=73ms TTL=246
Reply from 66.249.81.121: bytes=32 time=75ms TTL=246

Ping statistics for 66.249.81.121:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 71ms, Maximum = 75ms, Average = 73ms


So what if you get

C:\>ping mydomain.com
Ping request could not find host mydomain.com. Please check the name and try again.

C:\>ping www.mydomain.com

Pinging ghs.l.google.com [66.249.81.121] with 32 bytes of data:

Reply from 66.249.81.121: bytes=32 time=74ms TTL=246
Reply from 66.249.81.121: bytes=32 time=71ms TTL=246
Reply from 66.249.81.121: bytes=32 time=73ms TTL=246
Reply from 66.249.81.121: bytes=32 time=75ms TTL=246

Ping statistics for 66.249.81.121:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 71ms, Maximum = 75ms, Average = 73ms


What do you do now? Well, what we have discovered is that, despite having made the proper DNS setup (for both domain aliases), you may still see the disappointing result as immediately above. The successful setup for "mydomain.com" may only be seen, in your browser, once you have completed the final steps.
  1. Not published the blog to "mydomain.com" (you cannot do this).
  2. Published the blog to "www.mydomain.com".
  3. Selected "Redirect mydomain.com to www.mydomain.com.".
Here you have to take a step into the unknown, and try the final 2 steps. Domains ending in ".org", for instance, will generally show the first, preferred result when doing the ping test; domains ending in others, such as (but not limited to) ".com", will generally show the second, disappointing result.

Even after you complete the 2 final steps, and you are able to type "mydomain.com" into the browser address window, and see your web site displayed (though as "www.mydomain.com"), you may still get the second, disappointing result when doing a ping test. Try it and see.

If this article helps you, please comment below and let us know what TLD (".com", ".net", ".org", what have you?) your domain is part of. What you tell us may help others.

>> Top

12 comments:

Oslo IRC said...

In step 3, you write:
Selected "Redirect mydomain.com to www.mydomain.com.".

You mean the other way round, correct? I am experiencing problem you're describing (ie. ping only works for www.knowbodies.info, not for knowbodies.info)

Chuck said...

Oslo,

If you can publish to "knowbodies.info", then you may be able to redirect "www.knowbodies.info" to "knowbodies.info".

Generally, if you can only get a "CNAME" for "www.knowbodies.info" setup, you'll only be able to publish to "www.knowbodies.info". Then you have to redirect "knowbodies.info"" to "www.knowbodies.info"".

Does this make sense?

Oslo IRC said...

Yes, I think so...thanks! I suspect my problem then is that my DNS host, Network Solutions, does not allow me to set up a CNAME for knowbodies.info, only for www.knowbodies.info. So I have to find another domain host? Because in blogger.com, there's no way of redirecting from knowbodies.info to www.knowbodies.info...only the other way around, right?

Chuck said...

Oslo,

The redirection of "knowbodies.info", to "www.knowbodies.info", within Google, is useful only if there is a DNS entry to Google. Your readers, following a link to "knowbodies.info", won't be connecting to Google at all if your DNS host won't provide the initial "CNAME" referral.

So yes, if you want your custom domain to work, you have to have a host that will support "CNAME" referral for the primary domain.

The Wolf said...

Does GoDaddy allow that?

Because I've tried all this, but my page, www.extern-biosoft.com only loads with the "www". Without the "www" it sends me to a "parked by godaddy" page.

What should I do?

Chuck said...

Wolf,

This issue you need to be discussing in the Google Blogger Help - Broken forum, where we can converse easier.

E said...

Chuck - you are the man! Thank you - this was driving me nuts for a week now.

AC said...

Thank you for all the info - I have been working up and down with this problem and your info gave me the result!

Many thanks,

AC

Daniel said...

Thank you!!

I get my .pt domain, in Portugal, but in order to activate it I was asked to provide a nameserver + ip, something I wasn't able with ghs.google.com.
So, just signed up at zoneedit (free) and created a zone for my domain, there I get a nameserver + ip and add a CNAME alias pointing to ghs.google.com, the rest was just simple as you explained...
Everything works!

Ana said...

Chuck the info on your blog is absolutely the best. I am having this exact issue - I can't get my blog to publish to my primary domain. I have been going back and forth with google help desk and I'm starting to go crazy. Please help if you can.

My primary domain is: quiskaeya.com
My subdomain is: www.quiskaeya.com
My blogspot is: http://quiskaeyaskorner.blogspot.com.

After reading this post I feel I understand it, but because I am computer illiterate I'm afraid to do anything. Could you please advise? I would truly appreciate it.

Chuck said...

Ana,

You need to publish the blog to "www.quiskaeya.com", then select "Redirect quiskaeya.com to www.quiskaeya.com.". That's your only option, the way things are setup.

If that gives an error, deal with the error. Both the "Another blog ..." error, and the "Error 404 - Server Not Found" error are known and documented.

Sanskar Shrivastava said...

hi Just today I purchased the new domain. I updated Cname and Aname setting. and my blog is being displayed well at www.theworldreporter.com but not on theworldreporter.com. Will I have to wait for some more time? or i need to update some more settings? please throw some light. you have helped me a lot on Blogger help forum