1. Click on the Apple icon.
  2. Click System Preferences.
  3. Click Sharing.

The hostname will appear at the top of the window.