'needs a refactoring'

def req(self, *name, **args):

    import time
    import Lib
    self.argparse(name, args)
    protocol = self.args['protocol']
    self.port = self.args['port']
    opcode = self.args['opcode']
    rd = self.args['rd']
    server = self.args['server']
    if isinstance(self.args['qtype'], types.StringType):
        try:
            qtype = getattr(Type, string.upper(self.args['qtype']))
        except AttributeError:
            raise DNSError('unknown    query    type')
    else:
        qtype = self.args['qtype']
    if ('name' not in self.args):
        print self.args
        raise DNSError('nothing    to    lookup')
    qname = self.args['name']
    if (qtype == Type.AXFR):
        print 'Query    type    AXFR,    protocol    forced    to    TCP'
        protocol = 'tcp'
    m = Lib.Mpacker()
    m.addHeader(0, 0, opcode, 0, 0, rd, 0, 0, 0, 1, 0, 0, 0)
    m.addQuestion(qname, qtype, Class.IN)
    self.request = m.getbuf()
    try:
        if (protocol == 'udp'):
            self.sendUDPRequest(server)
        else:
            self.sendTCPRequest(server)
    except socket.error as reason:
        raise DNSError(reason)
    if self.async:
        return None
    else:
        return self.response
