How is "hostname" set?

When a machine boots up, how does it determine what its "hostname" is?

I'm trying to determine the "correct" way of changing a machine's hostname.

 

 

 

 

Top