curl-and-php
Re: Ignoring dns lookups in php / lib curl.
Date: Thu, 16 Dec 2004 15:22:17 +0100 (CET)
On Thu, 16 Dec 2004, Kevin Revill wrote:
> Can someone tell me what CURLOPT i need to ignore a host ip. I am trying to
> use curl to run performance tests against each machine in a cluster behind a
> load balancer.
>
> I need to make the request to a url, but have the request sent toa private
> ip.
>
> For instance. http://www.mydomain.co.uk host:10.0.0.5 then i can do it again
> to 10.0.0.6 and so on. hitting the right machine with the right url.
You don't do this by ignoring dns lookups. You do this by using your desired
IP in the URL and then add your host name in a custom Host: header:
So if I want to test my.host.com running on 10.0.0.5 for now, I can run this
command line:
curl -H "Host: my.host.com" http://10.0.0.5/path/to/file
... and you can do the equivalent with the PHP/curl binding as well.
-- Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se Dedicated custom curl help for hire: http://haxx.se/curl.htmlReceived on 2004-12-16