Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently got a domain and set it up with Google Apps including setting up sub-domains for the different services.

After set up the CNAME, all my subdomains point to ghs.google.com. I was wondering how this works with all subdomains pointing to the same site.

share|improve this question
up vote 1 down vote accepted

Your browser sends a request to Google's server with the Host: yoursite.com header.

Google looks up this hostname in a (very large) database mapping hostnames to websites, then serves the corresponding website.

This database includes App Engine apps, Google Apps aliases, BlogSpot blogs, and other things.

share|improve this answer
OK, but if that is the case, surely the header must be 'subdomain.mydomain.com` otherwise how would it know whether to look up a Blog or and App. – Saad Farooq Feb 27 '12 at 12:29
Try the live headers for firefox plugin and see whats being sent, but the process outline above is roughly how it works. – toomanyairmiles Feb 27 '12 at 15:10
Thanks. Firefox is awesome. So I guess the Google servers must differentiate on the basis of the the Host name passed in the headers. Makes sense. – Saad Farooq Feb 28 '12 at 1:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.