From: Tom T. <tkt...@gm...> - 2011-06-22 11:09:22
|
I would appreciate some assistance using the getSerial() method. I am in the process of learning Java so please forgive my ignorance and clumsiness. As you can see below I can retrieve the SOA record, but I'm unsure how to grab just the serial number field. Thank you for your time and assistance. import org.xbill.DNS.*; import java.util.Iterator; import java.net.UnknownHostException; public class DNSTest1 { public static void main(String[] args) throws UnknownHostException, TextParseException { SimpleResolver res = new SimpleResolver("192.168.22.187"); Lookup lookup = new Lookup("mydomain.com", Type.SOA); lookup.setResolver(res); lookup.run(); System.out.println(lookup.getAnswers()[0]); } } mydomain.com. 3600 IN SOA dns1.mydomain.com. abuse.mydomain.com. 326178217 10800 3600 1209600 3600 |