Our environment is setup with multiple apache httpd's that serve as reverse proxies to a various backend java servers (mostly tomcat servers).
We'd like to write a script to hit each individual ip address and check for a valid http response.
The httpd's are set up to use virtual hosts, so in order to validate the complete http/html response, we'll need to send http request to the domain name. In other words, sending a http request directly to a specific ip address would result in incorrect html http response from apache.
So, to summarize, we have multiple httpd's listening on multiple ip addresses. For example:
my.domain.com load balanced across:
192.168.11.1 192.168.11.2
We can programmatically update hosts file for each ip address and then make request to the domain name and check each individual ip address that way.
But, is there a way to make http request to a domain and have it resolve to a specific ip address without using hosts file? Maybe there's a java lib that can do this sort of thing programmatically?