This answer suggested using Netprofiles for a similar problem:
* Save your network settings as profiles.
* Automatically activate wireless profiles when specified wireless connections are detected. (XP only)
* Change IP Address, Subnet Mask, Default Gateway, Primary and Secondary DNS Servers, WINS Server, and DHCP settings with the click of a button.
* Specifiy different mapped drives for each profile.
* Change your default printer based on which profile you're currently using.
* Automatically change your profile via program shortcuts created with Net Profiles.
* Change the default homepage for Internet Explorer, Firefox, and Opera.
* Proxy settings for Internet Explorer, Firefox, and Opera.
* Run a user-defined list of programs when a profile is activated.
* Maintain seperate desktop wallper for each profile.
* Change screen resolutions and color quality when profiles are activated.
* Can be easily translated into other languages using the enclosed XML language file.
In this case, you could run a script that swaps in a HOSTS file (C:\Windows\system32\drivers\etc\hosts) that includes the sites you want to ignore as localhost aliases, eg:
# restrict access to certain sites without a firewall
Probably the easiest way to do this is to create two (or more) backup HOSTS files, say, HOSTS.normal and HOSTS.restricted, and put these entries in HOSTS.restricted. Then your script can copy HOSTS over with the HOSTS.restricted file when Netprofiles detects a restricted network, and another script copies HOSTS over with HOSTS.normal when Netprofiles detects a normal network.