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

Current behavior is C++ assertion failure. Closes #8187
Go ahead and remove the reference to the issue number. This and the other aforementioned checks should have been in here regardless.