dns: throw if lookup() hostname is not string or null

Current behavior is C++ assertion failure. Closes #8187
@trevnorris - the error message is new to this PR :-)