It's pretty easy really... if you think of names like a family, the domain name is your last name and the hostname is your first name. Here's a quick example:
developer.apple.com
The hostname would be "developer" the domain name "apple.com"
The default name for machines under OSX is...