dns: set hostname property on error object

Fixes #5393.

Suggested reviewers: @isaacs @jwalton