More robust hostname checking for RedHat [GH-1566]