javadnsippointersdnsjava

Using dnsjava to resolve a given IP to its Hostnames


I want to get a list of all registered Domains for a given IP Address . Could I use PTR records. I tried the following

ip = "217.13.68.220";
l = new Lookup(ip, Type.PTR );
l.setResolver(new SimpleResolver("8.8.8.8"));
l.run();

This IP should be resolved to zeit.de but the lookup returns:

host_not_found


Solution

  • For an IPV4 address, you need to

    1. Reverse the octets
    2. Append the in-addr.arpa domain

    So, in your case, you should pass "220.68.13.217.in-addr.arpa." to the resolver.