01: package CustomDNS;
02:
03: import java.lang.Exception;
04: import net.espeak.infra.cci.exception.*;
05: import net.espeak.jesi.*;
06: import ZoneAuthorityIntf;
07:
08: public class StubServer {
09:
10: public static void main(String[] args) {
11: try {
12: ESConnection core = new ESConnection();
13: ESServiceFinder finder = new ESServiceFinder(core,
14: "ZoneAuthorityIntf");
15: ESQuery query = new ESQuery("Name == 'randomhacks.com'");
16: ZoneAuthorityIntf auth = (ZoneAuthorityIntf) finder
17: .find(query);
18: for (int i = 0; i < 20; i++) {
19: String addr = auth
20: .getAddressForHost("foo1.randomhacks.com");
21: System.out.println(addr);
22: }
23: } catch (Exception e) {
24: System.err.println("StubServer: " + e.toString());
25: System.exit(1);
26: }
27: }
28: }
|