properly detect localhost

a blank hostname means localhost

Good news: we have fixed that in many places.

 https://bugzilla.redhat.com/show_bug.cgi?id=1050211

/cc @brandondunne