Server Fault is a question and answer site for system and network administrators. 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 am wondering how sites like Google sites and shopify allow customers to create a website and then link it to their own domain?. Google sites allow a user to create their own website, at a user supplied domain, and shopify allows a user to create their own e-commerce site - once again, they can supply their own domain to be used to access the webshop created.

In both cases, the website is ostensibly accesed by typing the users domain name in the browser, although the website is actually being hosted by a third party company (Google, Shopify etc)

How is this possible. Does anyone have an insight into how this is (likely) being done?

share|improve this question
up vote 0 down vote accepted

Google asks that you create a CNAME DNS record to point your domain at a host record of theirs.

For instance: IN CNAME

When your browser goes to, the DNS record redirects your request to the server The HOST header in the HTML request says that your browser is requesting and google's server sees this and points you to the appropriate content.

Shopify will work in much the same way.

share|improve this answer

HTTP 1.0 requests have a Host header, which the browser populates with the actual hostname in the URL, and that the server parses to find out which virtual host should handle the request.

share|improve this answer
tx for the answer. This is unlikely to be the correct answer though because it dosen't address several issues like DNS server resolution etc. – user35402 Jul 11 '10 at 7:55
DNS server resolution is trivial. The hostname points to the server's IP address, and there is no limit to the number of hostnames you can point at an address. – Ignacio Vazquez-Abrams Jul 11 '10 at 8:37
Hmm - not so sure. I thought the CNAME records would be the way to implemnt this functionality. Could you explain the precise steps by which a web server on can handle requests sent to and Generating HTML requests with special header information is trivial (speaking as a coder), so what you suggest would suit me better - but I dont see how it would work. For what you propose to work (IIUC), the user will have to manually change their nameservers. Google etc dont require manual intervention. – user35402 Jul 11 '10 at 9:48
There is no such thing as "a web server on". There are only web servers bound to IP addresses. Any number of hostnames can be pointed at an IP address. – Ignacio Vazquez-Abrams Jul 11 '10 at 10:13

It's very simple. The hosting provider sets up an HTTP server running on a given IP address. Let's suppose that's

Our web server can serve requests over HTTP destined for This is governed by DNS. I can have any number of DNS entries (A records) pointing to this IP, eg: IN A IN A IN A IN A

If your web browser supports HTTP/1.1, when you connect to this site, the address that you typed into your browser is sent to the web server. This is called a Host Header. The web browser then serves the virtual host matching the name you put in your browser. This is how name-based virtual hosts work.

Note, this is made possible because of HTTP/1.1 not 1.0 as stated in the first answer.

For a very simple overview of HTTP see:

For more detail, go to the RFCs.

share|improve this answer

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.