if (rec instanceof ARecord) {
ARecord arec = (ARecord) rec;
rmap.put("addr", arec.getAddress().getHostAddress());
}
else if (rec instanceof AAAARecord) {
AAAARecord arec = (AAAARecord) rec;
rmap.put("addrv6", arec.getAddress().getHostAddress());
}
else if (rec instanceof PTRRecord) {
PTRRecord ptr = (PTRRecord) rec;
rmap.put("target", ptr.getTarget().toString());
}