'See L{IHostnameResolver.resolveHostName}
@param resolutionReceiver: see interface
@param hostName: see interface
@param portNumber: see interface
@param addressTypes: see interface
@param transportSemantics: see interface
@return: see interface'

def resolveHostName(self, resolutionReceiver, hostName, portNumber=0, addressTypes=None, transportSemantics='TCP'):

    try:
        hostName = hostName.encode('ascii')
    except UnicodeEncodeError:
        hostName = _idnaBytes(hostName)
    hostName = nativeString(hostName)
    resolution = HostResolution(hostName)
    resolutionReceiver.resolutionBegan(resolution)
    onAddress = self._simpleResolver.getHostByName(hostName)
    def addressReceived(address):
        resolutionReceiver.addressResolved(IPv4Address('TCP', address, portNumber))
    def errorReceived(error):
        if (not error.check(DNSLookupError)):
            self._log.failure('while    looking    up    {name}    with    {resolver}', error, name=hostName, resolver=self._simpleResolver)
    onAddress.addCallbacks(addressReceived, errorReceived)
    def finish(result):
        resolutionReceiver.resolutionComplete()
    onAddress.addCallback(finish)
    return resolution
