Does anyone know how I can bypass DNS requests in a general way so that I can do, say: curl http://www.microsoft.com .. but bypassing the DNS lookup so that I can specify the IP I want the http request targetted at?
In a simple case I can just add www.microsoft.com to my hosts file, but if I wanted to write (say) a bash or PHP script which did this then it would get messy using hosts that way.
What I am looking to do is automate some checks which will run on an Apache server and ensure that all the virtual hosts on the server are working correctly. It is not possible to assume that all site shave the DNS pointed at the server (for example it may be a site which is being migrated to the server at some point in the near future).
I may just write my own code to make http(s) requests directly using a socket library or something a bit higher level than that but below curl, but I'd prefer to use a standard tool if possible.