def Query(self, request, timeout):
    question = str(request.question[0])
    if self.ip == BROKEN_IP:
      raise dns.query.BadResponse('This sucks.')

    if self.ip == NO_RESPONSE_IP:
      answer = self.FakeAnswer(request, no_answer=True)
    elif self.ip == GOOD_IP and  'www.google.com' in question:
      answer = self.FakeAnswer(request, no_answer=True)
    else:
      answer = self.FakeAnswer(request)

    if self.ip == GOOD_IP:
      time.sleep(0.001)
    elif self.ip == SLOW_IP:
      time.sleep(0.03)
    return answer
Return a falsified DNS response.
dataset/ETHPy150Open catap/namebench/libnamebench/mocks.py/MockNameServer.Query