Fix bug with valid hostnames with dashes. I added underscores even though they aren't valid just for good measure