Return resolving IP address(es) from host name.

async def resolve(
        self, host, port=80, family=None, qtype='A', logging=True
    ):
        """Return resolving IP address(es) from host name."""
        if self.host_is_ip(host):
            return host

        _host = self._cached_hosts.get(host)
        if _host:
            return _host

        resp = await self._resolve(host, qtype)

        if resp:
            hosts = [
                {
                    'hostname': host,
                    'host': r.host,
                    'port': port,
                    'family': family,
                    'proto': socket.IPPROTO_IP,
                    'flags': socket.AI_NUMERICHOST,
                }
                for r in resp
            ]
            if family:
                self._cached_hosts[host] = hosts
            else:
                self._cached_hosts[host] = hosts[0]['host']
            if logging:
                log.debug(
                    '%s: Host resolved: %s' % (host, self._cached_hosts[host])
                )
        else:
            if logging:
                log.warning('%s: Could not resolve host' % host)
        return self._cached_hosts.get(host)