http://qs321.pair.com?node_id=482727

mp has asked for the wisdom of the Perl Monks concerning the following question:

In order to implement a DNS-based failover scheme, I need a way to fetch a web page from a server whose IP address is not listed in an A-record for the domain name (the backup server).

I have tried a number of approaches using LWP, including Direct a LWP connection to a different host, but have not found any that work reliably.

Can anyone show how to do this?

I would think that I should be able to use the IP address in the URL (http://1.2.3.4/) and force a Host header in a LWP request somehow, but after looking at the LWP documentation and trying several different approach, I've not come up with anything that works. Any help will be greatly appreciated.