[Web4lib] name based virtual hosting and ip addresses

Rob Styles Rob.Styles at talis.com
Tue Jan 16 03:29:43 EST 2007


John,

What happens when you type the address of a web site into your browser is this:

The browsers asks the underlying operating systems to open a connection to the web server.

The operating system looks up the name it's been given in DNS and (hopefully) receives and IP Address back; it opens a connection to this IP address and hands that back to the browser.

The browser then sends a message down that connection; the message looks like this:

	GET / HTTP/1.1
	Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
	Accept-Language: en-us
	Accept-Encoding: gzip, deflate
	User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)
	Host: hypothetical.ora.com
	Connection: Keep-Alive

Literally like this, it's just plain text. Notice the line that starts "Host: " that's the information the server is using to decide which site to give you. It's probably got a default setup for if that's not there; that's what you'll see if you use the IP address in the browser.

So, because the server expects this information in the header of the request the browser doesn't provide any facility to add it anywhere else (AFAIK). There are some tools and plugins out there that allow you to mess with the headers, but they're probably overkill for what you want.

Now, how to solve your problem. The only reason I can think of for using the IP address in the browser's address bar is because DNS isn't working, so the name doesn't work. If that's the case you can use the fore-runner to DNS, the 'hosts' file. On UNIX or Linux systems this is typically in /etc/hosts (you'll need root access to modify it) and on windows it's in C:\WINDOWS\system32\drivers\etc\hosts. Either way it's a simple text file that you can edit using notepad or vi or any text editor. The file usually has examples in it to show you what to put in, but it's just IP address <tab> hostname. If you're using a proxy server this entry will have to go on the proxy server, not the browsing machine.

The downside to that, of course, is that if the site moves IP address then you will have to know and update your machines manually.

Why do you need to do this?

Rob Styles
Technical Lead, Talis
 

> -----Original Message-----
> From: web4lib-bounces at webjunction.org [mailto:web4lib-
> bounces at webjunction.org] On Behalf Of John Fitzgibbon
> Sent: 15 January 2007 16:40
> To: web4lib at webjunction.org
> Subject: [Web4lib] name based virtual hosting and ip addresses
> 
> Hi,
> 
> I am attempting to access a web site that is served by a web server that
> uses a type of hosting called name-based virtual hosting. The server
> hosts several domains and serves the correct page based on the domain
> name submitted to it. Simply, typing the IP address of the domain in the
> address bar will not work; the domain name must also be submitted to the
> server.
> 
> With such hosting, is it possible to retrieve the web site by typing the
> IP address in the address bar along with additional information? What
> form should this additional information take?
> 
> Regards
> John
> 
> John Fitzgibbon
> 
> p: 00 353 91 562471
> f: 00 353 91 565039
> w: http://www.galwaylibrary.ie
> 
> John Fitzgibbon
> 
> p: 00 353 91 562471
> f: 00 353 91 565039
> w: http://www.galwaylibrary.ie
> 
> *******************************************************************
> Tá eolas atá príobháideach agus rúnda sa ríomhphost seo
> agus aon iatán a ghabhann leis agus is leis an duine/na daoine
> sin amháin a bhfuil siad seolta chucu a bhaineann siad.
> Mura seolaí thú, níl tú údaraithe an ríomhphost nó aon iatán
> a ghabhann leis a léamh, a chóipáil ná a úsáid.
> Má tá an ríomhphost seo faighte agat trí dhearmad,
> cuir an seoltóir ar an eolas thrí aischur ríomhphoist
> agus scrios ansin é le do thoil.
> 
> This e-mail and any attachment contains information which is
> private and confidential and is intended for the addressee
> only. If you are not an addressee, you are not authorised
> to read, copy or use the e-mail or any attachment.
> If you have received this e-mail in error, please notify
> the sender by return e-mail and then destroy it.
> *********************************************************************
> _______________________________________________
> Web4lib mailing list
> Web4lib at webjunction.org
> http://lists.webjunction.org/web4lib/
 
The very latest from Talis
read the latest news at www.talis.com/news 
listen to our podcasts www.talis.com/podcasts 
see us at these events www.talis.com/events 
join the discussion here www.talis.com/forums 
join our developer community www.talis.com/tdn 
and read our blogs www.talis.com/blogs

 
Any views or personal opinions expressed within this email may not be those of Talis Information Ltd. The content of this email message and any files that may be attached are confidential, and for the usage of the intended recipient only. If you are not the intended recipient, then please return this message to the sender and delete it. Any use of this e-mail by an unauthorised recipient is prohibited.
 
 
Talis Information Ltd is a member of the Talis Group of companies and is registered in England No 3638278 with its registered office at Knights Court, Solihull Parkway, Birmingham Business Park, B37 7YB.


More information about the Web4lib mailing list