Testing a new web server w/o fiddling w/DNS

At $WORK I'm slowly migrating our website to a new server. I came up with a Small but Useful(tm) program called Thornhill to help; it looks at Apache Alias directives, then queries both the old and the new server to make sure the results are the same. Since the new server doesn't have DNS pointed at it yet, this requires some trickery.

I'm using Perl's WWW::Mechanize module to do this, and after some thought I figured I could just add a new Host: oldhost.example.org header to the request. And that works; even though the request is going to the new host, it's still asking for the URL of the website. IOW, it's querying it as though it were live. And lo, my tests came back mostly passing, and there was much rejoicing.

Except that I noticed I was getting redirects for some things. Which makes sense -- /java_app should probably go to /java_app/, and then to /java_app/home.html?jsessionid=666. But those go to the current, live site:

So basically Thornhill works up until the point where it gets redirected. ARGHH.

In theory I can override this in the module, but this turns out to be surprisingly difficult. And WWW::Mechanize has a TODO list a mile long, including an option to not follow redirects. And I ran into the same dang bug I ran into five years ago.

I'm trying Python now. But I'm starting to wonder if I should just abandon this approach and fiddle with the /etc/hosts file or something. This is getting...tedious? finicky? ridiculous? Something.

UPDATE: Python Requests is the bomb.