[sclug] domain / www hosting

Ed Davies sclug at edavies.nildram.co.uk
Sun Dec 24 17:57:39 UTC 2006


Simon Huggins wrote:
> This is mostly irrelevant.  The hosting provider sets up a virtual host
> for that website and the fact that you do the DNS or that they do the
> DNS makes no difference neither to the Host: header that your browser
> will supply nor to the IP that the same browser contacts.

OK.  I'm obviously not understanding something.  Here's an example of
how I think these sort of things work.

I have some web space on Nildram's servers (www.edavies.nildram.co.uk).
A chain of CNAME records point that to saturn.nildram.co.uk which has
an IP address of 195.149.33.75.  Suppose I was to go to Black Cat and
register edavies.name.uk and set up a DNS A record for www.edavies.name.uk
pointing to 195.149.33.75.  If a browser referenced www.edavies.name.uk
then it would send a GET request to 195.149.33.75 (fine so far) but
with the Host: header containing www.edavies.name.uk.  Nildram's
server would say WTF is that and reject the request.

I could go to Nildram and ask them to set up a virtual host server
for www.edavies.name.uk.  They'd say fine, that'll be an extra so many
pounds a year for commercial web hosting.  In this sense, they can
insist (as you asked in an earlier message in this thread) that they
do the DNS hosting - specifically hosting domain names which fit in
with their pattern of domain names.

Is this right or is there some other way to use the virtual host
with the "wrong" domain name?

> CNAMEs are a red herring here.  Ultimately your web browser resolves it
> to an IP anyway which it then connects to and when the web server sees a
> connection it doesn't know that you've resolved it via an A record or a
> CNAME to an A record at all (hence the need for a Host: header for
> virtual hosting).

I wasn't sure if the browser would follow the CNAME in deciding the
contents of the Host: header.  Looking at my own web site's setup
with _dig_ shows that the browser obviously doesn't otherwise
Nildram's virtual hosting wouldn't work - so yes, CNAMEs are a red
herring.

Ed Davies.



More information about the Sclug mailing list