cURL / Mailing Lists / curl-users / Single Mail


Re: Ignore DNS

From: Daniel Stenberg <>
Date: Wed, 12 Jun 2002 19:48:26 +0200 (MET DST)

On Wed, 12 Jun 2002, Warrick FitzGerald wrote:

> I very often would like to make a request to a specific IP Address, but
> keep the host header etc exactly as if curl had done the lookup via DNS.
> For eample if I have 3 web servers behind a load ballancer, I would like to
> be able to make a request directly to Machine1's private address, with
> excly the same header as if it had resolved to the LoadBallanced IP.
> Is it possible to do something like curl --user-this-ip
> ?

Yes it is indeed possible. You just need to "scramble" the options a little:

 curl --header "Host:"

This makes a HTTP request to and replaces the otherwise internally
generated "Host:" header with one of your own choice. The Host: header is
what tells the server which (virtual) server you want.

    Daniel Stenberg -- curl groks URLs --
Sponsored by:
ThinkGeek at
Received on 2002-06-12