Check for hostname validity