Local network hostnames don't have a standard format, but they cannot contain spaces and other special characters like commas, periods, and apostrophes. For example, if your name your Mac, "Mike's iMac", the hostname will automatically be translated to "Mikes-iMac.local". If you're a Mac user, you can customize your computer's hostname by modifying the computer name in the Sharing System Preference. If you use a Windows PC, you can modify your hostname by changing the computer name within the System Control Panel.
Internet hostnames are simply domain names, like techterms.com. They are typically fully qualified domain names, such as www.techterms.com or ftp.techterms.com, since each subdomain is a different hostname. However, if a website URL does not include a domain prefix like "www," then the domain name itself (e.g. "techterms.com") can serve as the hostname.
In both local networks and wide area networks like the Internet, hostnames are translated to IP addresses using DNS. Either a local or remote DNS server maps each hostname to a unique IP address, which is how the device is actually identified on a network. Therefore, hostnames are simply used as human-readable labels, which makes it easy to remember names of devices on a network and websites on the Internet.