core/net/resolv: Incorporate name of the target into the default hostname.

Also adds some additional debug logging.