use of org.minidns.dnsmessage.DNSMessage.Builder in project minidns by MiniDNS.
the class NSIDTest method testNsidLRoot.
@IntegrationTest
public static NSID testNsidLRoot() {
DNSClient client = new DNSClient(null) {
@Override
protected Builder newQuestion(Builder message) {
message.getEdnsBuilder().addEdnsOption(NSID.REQUEST);
return super.newQuestion(message);
}
};
DNSMessage response = null;
Question q = new Question("de", TYPE.NS);
for (InetAddress lRoot : IterativeDNSClient.getRootServer('l')) {
try {
response = client.query(q, lRoot);
} catch (IOException e) {
continue;
}
break;
}
NSID nsid = response.getEdns().getEdnsOption(OptionCode.NSID);
assertNotNull(nsid);
return nsid;
}
Aggregations