title: Valid characters of a hostname?
body: <p>What are the valid characters of a hostname? This would be something like a networked computer or a web domain.</p>
  
  <p>To put it in context, I am writing a PC game which connects to a remote server; so I have a field for hostname and a field for port. Obviously the port is a number in the Short range, but I need to know what all the possible hostname characters are (and any other pattern that might be required - does a hostname need to start with a letter?).</p>
  
  <p>Examples of hostname include <code>localhost</code> or <code>google.com</code>.</p>