# File lib/net/dns/resolver.rb, line 859
      def search(name,type=Net::DNS::A,cls=Net::DNS::IN)

        return query(name,type,cls) if name.class == IPAddr

        # If the name contains at least one dot then try it as is first.
        if name.include? "."
          @logger.debug "Search(#{name},#{Net::DNS::RR::Types.new(type)},#{Net::DNS::RR::Classes.new(cls)})"
          ans = query(name,type,cls)
          return ans if ans.header.anCount > 0
        end

        # If the name doesn't end in a dot then apply the search list.
        if name !~ /\.$/ and @config[:dns_search]
          @config[:searchlist].each do |domain|
            newname = name + "." + domain
            @logger.debug "Search(#{newname},#{Net::DNS::RR::Types.new(type)},#{Net::DNS::RR::Classes.new(cls)})"
            ans = query(newname,type,cls)
            return ans if ans.header.anCount > 0
          end
        end

        # Finally, if the name has no dots then try it as is.
        @logger.debug "Search(#{name},#{Net::DNS::RR::Types.new(type)},#{Net::DNS::RR::Classes.new(cls)})"
        query(name+".",type,cls)

      end