def METHOD_NAME(self, data, addr):
    logger.info(f'Dns server received {len(data)} bytes from {addr}')
    self.times_called += 1
    assert len(data) == 32
    # Copy request data
    response: bytes = b''
    response += data[0:2]  # 2 bytes txn id
    response += _set_response(data[2:4])  # 2 bytes flags
    response += data[4:6]  # 2 bytes queries count
    response += b'\x00\x01'  # 2 bytes answers count
    response += data[8:]  # Copy queries
    logger.info(f'requested query {data[8:]}')
    self.queries.append(f'{data[13:23].decode()}.{data[24:27].decode()}')
    query_type = data[-4:-2]
    response += b'\xc0\x0c'  # compression pointer to qname
    response += query_type  # query type
    response += struct.pack('!H', 1)  # class IN
    response += struct.pack('!I', 99999)  # TTL
    if query_type == b'\x00\x01':  # type A record
        response += struct.pack('!H', 4)  # data length (IPv4)
        response += socket.inet_pton(
            socket.AF_INET, '77.88.55.55',
        )  # our fake IPv4 address
    elif query_type == b'\x00\x1c':  # type AAAA record
        response += struct.pack('!H', 16)  # data length (IPv6)
        response += socket.inet_pton(
            socket.AF_INET6, '2a02:6b8:a::a',
        )  # our fake IPv6 address
    else:
        raise Exception('unknown type')
    logger.info(f'Dns sends {len(response)} bytes to {addr}')
    self.transport.sendto(response, addr)