# File lib/dnstraverse/message_utility.rb, line 44
    def msg_validate(msg, args)
      a = args.dup
      a[:qclass]||= 'IN'
      return true if msg.rcode != Dnsruby::RCode.NOERROR
      begin
        if msg.question.size != 1 then
          raise ResolveError, "#{msg.answerfrom} returned unexpected " +
          "question size #{msg.question.size}"
        end
        for c in [:qname, :qclass, :qtype] do
          if a[c] and
            a[c].to_s.downcase != msg.question[0].send(c).to_s.downcase then
            raise ResolveError, "#{msg.answerfrom} returned mismatched #{c} " +
          "#{msg.question[0].send(c)} instead of expected #{a[c]}"
          end
        end
      rescue => e
        Log.debug { "Failed message was: " + msg.to_s }
        raise e
      end
      return true
    end