Disallow dot and hyphen as first character of hostnames

- Causes hostname to be set to an invalid value on some systems which
  also causes malfunction of hostname -f so it cannot be changed
Merge pull request #2358 from sgronblo/disallow_dots_and_hyphens_at_start_of_hostname

core: disallow dot and hyphen as first character of hostnames