What I want to do is to send a curl request to example.com but rather than using a DNS lookup I want to specifically send the request to say 1.1.1.1
I want to do this because I want to know for certain which of our servers the request is going to and not be bumped around by a load balancer.
I wonder if there is something like this:
$ch = curl_init();
curl_setopt( CURLOPT_URL, 'example.com' );
curl_setopt( CURLOPT_ENDPOINT_IP, '1.1.1.1' ); // <= is there something like this?
I'm pretty sure there isn't a mechanism within curl itself to do this, but how could I achieve this effect?
The server at the IP itself is running vhosts and so its important that the HTTP request includes a named Host and not an IP, which is why I need to put a named host in the request but attach to it by IP address.