Also, turn an absent hostname into a BUG(), not a crash. Found by scan-build. Closes ticket 28879; bugfix on 0.1.2.7-alpha