|
From: srnec <pet...@gm...> - 2013-03-20 13:16:54
|
Hi!
I need some advise. Im working on project where I need to get NS records for
list of domains (aprox. 280 000) and I need to get AAAA record for those NS
record (if they had).
My task is to test those domains if they had IPv6 support (name servers have
IPv6 address).
I tried to do it with dnsPython but I had bad results. Speed of that script
was very impressive, but I had problem getting answers for those records
after short period of time. (I got mostly timeout exception for every
record).
Now im trying to do it in dnsjava.
With my code I have speed aprox. 1min for 100 domains.
Is there any solution to speed it up?
if I am not mistaken, I read that dnsjava use threads for lookups so it
would be bad idea to insert part of the code in another threads to speed it
up?
try {
Lookup lookup = new Lookup(domain,Type.NS);
lookup.setCache(null);
Record[] records = lookup.run();
for (int i=0; i<records.length; i++) {
NSRecord ns = (NSRecord) records[i];
Record[] ip = new Lookup(ns.toString(), Type.AAAA).run();
try {
System.out.println(id_domain + " - " + ns.getTarget() + " - "
+ ip[0].rdataToString());
} catch (NullPointerException ep) {
System.out.println(id_domain + " - " + ns.getTarget() + " -
N/A");
}
}
} catch (TextParseException ex) {
Logger.getLogger(TestDnsjava.class.getName()).log(Level.SEVERE, null,
ex);}
catch (NullPointerException ep) {
System.out.println(id_domain + " - " + domain + " - no NS");
}
and finally I apologized for my bad English :)
--
View this message in context: http://old.nabble.com/resolve-thousands-of-domain-names-%28NS%2CAAAA-records%29-tp35197068p35197068.html
Sent from the dnsjava-users mailing list archive at Nabble.com.
|