If you believe that the only way to test multiple front end servers that are using host headers is by changing your host file, I have some good news. That is SO not true.
A bit of a recap: (non geeks can skip this)
What is a host header?
A host header is used to identify to what website the requester wants the request to go.
Why do I need it
Web servers work, by listening to requests for web pages, on a predefined port. Normally to have a more efficient use of a server it would be able to handle several websites at once. However there is a bit of a catch. If you have 1 ip address on a given server, you can only setup 1 site, to respond on that server on port 80. So if you want to run a second site on that server you need to have another ip address to listen on. So that is why the clever people introduced the host header. So now you can have 2 sites listening on port 80, and IIS looks at the incoming request for a page, and then looks at the host header, if it has a web site that is listening on that host header, it forwards the request to that specific site.
So that makes it quite difficult to test your website that is sitting on multiple servers, and have multiple sites on each server, except if you go down one layer of abstraction.
If you use TinyGet (found here: http:// support.microsoft.com/kb/840671) you can change how the normal request looks like a bit.
So a normal request to http://google.com will look like this in TinyGet

There are a couple of things to notice.
The Command:
TinyGet –srv:www.google.co.za –uri:/ -t
If you want to know more about the syntax and stuff read the help document
The bit that says request: **********
It has a GET – the verb to use in the request
Host: …. That is the host header
Accpet: */* that says what the client programs accepts.
The rest that follows is what you get back from the server.
So if we want to request a page from a server where we know the IP Address for we can use a command like the following ( I just pinged www.google.co.za, and guested that another web server will be listening on 99)
tinyget.exe -srv:209.85.229.100 -uri:/ -reqheaders:”host:www.google.co.za \n” –t
tinyget.exe -srv:209.85.229.99 -uri:/ -reqheaders:”host:www.google.co.za \n” –t
The magic is done by the –reqheaders bit
So we requesting from a specific IP address but we saying to the server, treat this request as if I actual request it from www.google.co.za instead of the IP address
Happy testing
Posted by Rihan Meij