In short: there is an auto-magic behavior that Mac OS uses, by default.
You can turn it off in /etc/hostconfig.
I like the answer by Jack M., but it doesn't work in many environments of the real-world DHCP environments, because you do not have a pre-existing relationship with the DHCP server. Only in a home setup or a corporate setup (where the IT people are helpful), can you get your desired hostname via DHCP.
/etc/hostconfig add something like this:
If you want to set it at automatic again, either remove the line or set it to