private void
lookup(Name current) {
	SetResponse sr = cache.lookupRecords(current, type, credibility);
	if (verbose) {
		System.err.println("lookup " + current + " " +
				   Type.string(type));
		System.err.println(sr);
	}
	processResponse(current, sr);
	if (done || doneCurrent)
		return;

	Record question = Record.newRecord(current, type, dclass);
	Message query = Message.newQuery(question);
	Message response = null;
	try {
		response = resolver.send(query);
	}
	catch (IOException e) {
		// A network error occurred.  Press on.
		if (e instanceof InterruptedIOException)
			timedout = true;
		else
			networkerror = true;
		return;
	}
	int rcode = response.getHeader().getRcode();
	if (rcode != Rcode.NOERROR && rcode != Rcode.NXDOMAIN) {
		// The server we contacted is broken or otherwise unhelpful.
		// Press on.
		badresponse = true;
		badresponse_error = Rcode.string(rcode);
		return;
	}

	if (!query.getQuestion().equals(response.getQuestion())) {
		// The answer doesn't match the question.  That's not good.
		badresponse = true;
		badresponse_error = "response does not match query";
		return;
	}

	sr = cache.addMessage(response);
	if (sr == null)
		sr = cache.lookupRecords(current, type, credibility);
	if (verbose) {
		System.err.println("queried " + current + " " +
				   Type.string(type));
		System.err.println(sr);
	}
	processResponse(current, sr);
}
Sets the minimum credibility level that will be accepted when performing
the lookup.  This defaults to Credibility.NORMAL.
@param credibility The minimum credibility level.
src/main/java/core/org/xbill/DNS/Lookup.java