def METHOD_NAME(self, data):
    request = DNSRecord.parse(data)
    logger.debug('%s', request)
    reply = DNSRecord(
        DNSHeader(id=request.header.id, qr=1, aa=1, ra=1), q=request.q
    )
    qname = request.q.qname
    qn = str(qname)
    if qn.endswith('.'):
        qn = qn[:-1]
    qtype = request.q.qtype
    qt = QTYPE[qtype]
    qnhost, qndomain = qn.split('.', 1)
    #
    # OK, so we are not conformant to the standards at all, as we never
    # return any SOA records and stuff...
    #
    if qndomain == settings.IPAUTH_DNSSERVER_DOMAIN:
        if qt in ['*', 'A']:
            for u in User.objects.filter(iptouser__isnull=False):
                if qnhost == username_to_hostname(u.username):
                    for itu in u.iptouser_set.all():
                        reply.add_answer(
                            RR(
                                rname=qname,
                                rtype=QTYPE.A,
                                rclass=1,
                                ttl=self.server.command.options['ttl'],
                                rdata=A(itu.ip_addr),
                            )
                        )
    elif qn.endswith('.in-addr.arpa'):
        if qt in ['*', 'PTR']:
            qn = qn[: -len('.in-addr.arpa')]
            parts = qn.split('.')
            if len(parts) == 4:
                ip = '.'.join(reversed(parts))
                try:
                    iptu = IpToUser.objects.get(ip_addr=ip)
                    fqdn = (
                        username_to_hostname(iptu.user.username)
                        + '.'
                        + settings.IPAUTH_DNSSERVER_DOMAIN
                        + '.'
                    )
                    reply.add_answer(
                        RR(
                            rname=qname,
                            rtype=QTYPE.PTR,
                            rclass=1,
                            ttl=self.server.command.options['ttl'],
                            rdata=PTR(fqdn),
                        )
                    )
                except IpToUser.DoesNotExist:
                    pass
    logger.debug('%s', reply)
    return reply.pack()