'Calculate the response to a query.'

def _doDynamicResponse(self, query):

    name = query.name.name
    labels = name.split('.')
    parts = labels[0].split(self._pattern)
    lastOctet = int(parts[1])
    answer = dns.RRHeader(name=name, payload=dns.Record_A(address=('%s.%s' % (self._network, lastOctet))))
    answers = [answer]
    authority = []
    additional = []
    return (answers, authority, additional)
