If I added hostname param to the request headers, it’s ignored.
The best way to change the hostname your script is pointing to is to modify the hostname field in the Server Properties. Go to the Server list above your Virtual User profiles, open the one that your script is currently using and pointing to, and modify the hostname field only to the new hostname you want it to use, or use a variable that you can change when needed. Let us know if this suits your needs.