From: Brian W. <bwe...@xb...> - 2010-11-03 21:56:58
|
On Nov 3, 2010, at 1:51 PM, Rafael Diniz wrote: > As i have read, problems due to the code must be sent through this list, so, here we go! :) > > Well, using the Eclipse Galileo for windows over here. > I´m coding a small void main trying to test the DNS Dynamic update example from the oficial website. > > My idea is that when my DNS fails this small code could use another DNS so that my application keep working properly. > > Resume: > If the default DNS fails, the dynamic update could bring me, in some sort of a real time, another DNS that works (8.8.8.8. google dns maybe). I think you're confused. There is no concept of "the default DNS" when sending dynamic updates; you need to specify where the updates are sent. If you specify a server that doesn't accept dynamic updates, it should fail, and the root servers do not (and should not) accept dynamic updates. There's no way to fall back to another server which would accept them, because there aren't any DNS servers that accept dynamic updates from anyone. The Google servers certainly don't. I don't know why you believe that any DNS server on the Internet would trust you enough to let you make changes to its data. If you want to send dynamic updates, you need to either set up your own DNS server and zone that you're permitted to make updates to, or have the administrator of some other server and zone grant you update privileges. Brian > this is the code: > > > public static void DNSDynamicUpdate() throws Exception > { > System.out.println("\n" + "DNSDynamicUpdate" + "\n"); > String selfHost = "192.168.0.156"; > String hostIP = "128.63.2.53";//one of the root dns //google dns 8.8.8.8 > String gateway = "192.168.0.254";//my wireless gateway > > if(QueryRemoteserver(hostIP)) > { > Name zone = Name.fromString("root-servers.net."); > Name host = Name.fromString("h", zone); > Update update = new Update(zone); > update.replace(host, Type.A, 3600, gateway); > > Resolver res = new SimpleResolver(hostIP); > //com md5 > res.setTSIGKey(new TSIG(host, base64.fromString("1234"))); > //res.setPort(53); > res.setTCP(true); > > Message response = res.send(update); > > System.out.println("\n" + response + "\n"); > } > } > > public static boolean QueryRemoteserver(String hostIP) throws Exception > { > if(hostIP == null) > hostIP = "128.63.2.53"; > System.out.println("\n" + "QueryRemoteserver" + "\n"); > Lookup l = new Lookup("version.bind.", Type.TXT, DClass.CH); > l.setResolver(new SimpleResolver()); > l.run(); > if (l.getResult() == Lookup.SUCCESSFUL) > { > System.out.println(l.getAnswers()[0].rdataToString()); > return true; > } > else > { > System.out.println(l.getAnswers()[0].rdataToString()); > return false; > } > > } > response: > ;; ->>HEADER<<- opcode: UPDATE, status: NOTIMP, id: 48592 > ;; flags: qr ; qd: 0 an: 0 au: 0 ad: 0 > ;; TSIG invalid > ;; ZONE: > > ;; PREREQUISITES: > > ;; UPDATE RECORDS: > > ;; ADDITIONAL RECORDS: > > ;; Message size: 12 bytes > > > > Thanks in advance... > > PS: NOTAUTH was the most received message in my "testes" > ------------------------------------------------------------------------------ > The Next 800 Companies to Lead America's Growth: New Video Whitepaper > David G. Thomson, author of the best-selling book "Blueprint to a > Billion" shares his insights and actions to help propel your > business during the next growth cycle. Listen Now! > http://p.sf.net/sfu/SAP-dev2dev_______________________________________________ > dnsjava-users mailing list > dns...@li... > https://lists.sourceforge.net/lists/listinfo/dnsjava-users |