def error(rcode:, question:nil)
      question = question || @questions[0]

      return Packet.new(
        trn_id: @trn_id,
        qr: QR_RESPONSE,
        opcode: OPCODE_QUERY,
        flags: FLAG_RD | FLAG_RA,
        rcode: rcode,
        questions: [question],
        answers: [],
      )
    end
def error(rcode:, question:nil)
      question = question || @questions[0]

      return Packet.new(
        trn_id: @trn_id,
        qr: QR_RESPONSE,
        opcode: OPCODE_QUERY,
        flags: FLAG_RD | FLAG_RA,
        rcode: rcode,
        questions: [question],
        answers: [],
      )
    end
Convert a query packet to the corresponding error answer with the given
 rcode (see constants.rb for a list of rcodes).