What is the "host name" in bash? (\h or \H)
First, you need to set your system name in System Preferences > Sharing > Computer Name. Let's assume for now that you set it to MyComputerName.

The next step is to make sure your computer name is not overridden by DHCP client (which is normally what happens and what you have observed - each time a DHCP server assigns and IP address to your computer, your mac will use the hostname associated with that IP address as its own).

To do that, you need to, in Terminal.app change the content of the /etc/hostconfig file, adding something similar to this: 

HOSTNAME="MyComputerName"


where MyComputerName is a text string corresponds to the host name you set in System Preferences. 

If you ever need to set it to change the hostname automatically based on the address received from the DHCP server, you can either remove this line from the /etc/hostconfig file or change it's value to -AUTOMATIC- instead of the "MyComputerName". 

Finally, in bash you use \h as the host name token - so e.g. you can set your PS1 to:

PS1='[\u@\h \w] '