When I connect to various VPN servers (Windows PPTP, Cisco IPSEC) the hostname of my laptop gets updated.
Is there a setting somewhere that will stop this from happening?
The VPN's DNS server probably assigns hostname together with the IP address and the computer uses it instead of what you've set during setup and what appears in System Preferences -> Sharing -> Computer name.
To set a permanent hostname do
sudo scutil --set HostName DesiredHostname in Terminal.app (there are also ComputerName and LocalHostName that can be changed there).
You can still* set it in
/etc/hostconfig, by adding
HOSTNAME=DesiredHostname at the bottom of the file.
(*I am using this, but it may be depreciated at some point as the beginning of that file says
# This file is going away).
Restart may be required in either case.