I want to be able to send an HTTP request to "admin.foo.com", but have the request go to an IP which does not map to "admin.foo.com" in DNS. I know I can edit /etc/hosts to do this, but I'd like to avoid doing that.
To explicate, normally when you browse to "http://admin.foo.com"
, it sends an HTTP request that looks something like this:
GET / HTTP/1.0
User-Agent: Wget/1.10.2 (well, it'd be Firefox, but you get the point)
Accept: */*
Host: admin.foo.com
Connection: Keep-Alive
...and that request is sent to admin.foo.com's IP, which (let's say) is 10.0.0.1. The "Host" header is extracted from the URL, and that header is what Apache uses to determine which virtual host to use. If I put the IP address of admin.foo.com into Firefox, it sends the request to the right server, but the Host field has the IP address in it, and then Apache doesn't know what vhost to use, and defaults to using no vhost at all, which (in its config) causes a 403/Forbidden, so I can't navigate to the new server's IP to test this.
Again, I know I can use /etc/hosts for this, but I'd like to avoid doing so, and I figure Firefox must have some sekrit way to do this ;)