code: def make_response(query, recursion_available=False, our_payload=8192):
      
  
      if query.flags & dns.flags.QR:
          raise dns.exception.FormError('specified query message is not a query')
      response = dns.message.Message(query.id)
      response.flags = dns.flags.QR | (query.flags & dns.flags.RD)
      if recursion_available:
          response.flags |= dns.flags.RA
      response.set_opcode(query.opcode())
      response.question = list(query.question)
      if query.edns >= 0:
          response.use_edns(0, 0, our_payload, query.payload)
      if not query.keyname is None:
          response.keyname = query.keyname
          response.keyring = query.keyring
          response.request_mac = query.mac
      return response
docs: Make a message which is a response for the specified query.
      The message returned is really a response skeleton; it has all
      of the infrastructure required of a response, but none of the
      content.
  
      The response's question section is a shallow copy of the query's
      question section, so the query's question RRsets should not be
      changed.
  
      @param query: the query to respond to
      @type query: dns.message.Message object
      @param recursion_available: should RA be set in the response?
      @type recursion_available: bool
      @param our_payload: payload size to advertise in EDNS responses; default
      is 8192.
      @type our_payload: int
      @rtype: dns.message.Message object