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.


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.

| 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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