dns: include host name in error message if available

This makes errors more readable and similar to FS errors, which also
include file name.