How can I do redirect all incoming requests from one domain to another and still keep the path and query?

Example 
from: <http://domain1.com/some/path/?query> to: <http://domain2.com/some/path/?query>.

I've been fooling around with the system.webserver in web.config, HTTP-handlers and global.asax - but without luck. I only get 404s (because the content has been moved)... 

Thanks!