_cacheMisses++;
try {
SimpleResolver resolver = new SimpleResolver(_dnsServerAddress);
// allocate a simple resolver object ...
//NIODNSSimpleResolverImpl resolver = new NIODNSSimpleResolverImpl(this, _dnsServerAddress);
// use tcp if requested ...
if (useTCP)
resolver.setTCP(true);
// set the timeout ...
resolver.setTimeout(timeoutValue);
// create appropriate data structures ...
Name name = Name.fromString(hostName, Name.root);
Record rec = Record.newRecord(name, Type.A, DClass.IN);
Message query = Message.newQuery(rec);
// send it off ...
try {
response = resolver.send(query);
} catch (IOException e) {
if (_logger != null)
_logger.logDNSException(hostName, StringUtils
.stringifyException(e));