if( !queryValue.endsWith( "." ) && !queryValue.endsWith( domain ) )
queryValue = queryValue + "." + domain;
if( sect.getQClass() == QuerySection.QUERY_TYPE_PTR ){
RBListEntry entry = server.getBlockList().lookup( queryValue );
if( entry != null && ! entry.isExpired() ){
response.add( new PtrRecord( queryValue, queryValue, entry.getRemainingLifetime() ) );
} else {
response.setStatus( Response.RC_NAME_ERROR );
break;
}
}
if( sect.getQType() == QuerySection.QUERY_TYPE_A ){
queryValue = this.preprocess( source, queryValue );
RBListEntry entry = server.getBlockList().lookup( queryValue );
if( entry != null && !entry.isExpired() ){
log.debug( "Entry '{}' is on block list and will expire in {} seconds", queryValue, entry.getRemainingLifetime() );
response.add( new ARecord( queryValue, RblServer.BLOCKED_VALUE, entry.getRemainingLifetime() ) );
} else {
log.debug( "Removing expired entry..." );
response.setStatus( Response.RC_NAME_ERROR );
if( entry != null )
server.getBlockList().remove( entry.getName() );
}
} else {
response.setStatus( Response.RC_NAME_ERROR );
}
}