Find out the domain for a given IPv4 / IPv6 address (not rDNS / PTR)

Can I get domain names that are IPv4 / IPv6 resolved?

I would suggest there must be a way to query the system DNS cache, but I haven't found a suitable solution.

Also, I am not interested in rDNS / PTR, which is fairly easy to obtain, but in the domain names recently resolved by the system, it indicates a given IP address.

My main interest is Android OS, but you can also issue solutions for other platforms.

+3


source to share


2 answers


Android does not have OS level DNS cache, see

https://android.stackexchange.com/questions/18002/is-there-a-way-to-list-the-local-dns-cache

Edit: This seems to depend on the Android version. Current releases use Bionic DNS caching, see



http://osxr.org/android/source/bionic/libc/netbsd/resolv/res_cache.c

The cache can be retrieved using __ get_res_cache . This is an in-memory cache.

If you have access to a configured recursive resolver, you can try to access its cache (for example, by logging into it, or by installing a service to access the cache remotely).

+2


source


There is no general way to do what you ask for. There may be ways to trick the internals of whatever DNS resolution system you use to see what happened to end up in its cache (or the like), but this will be highly system dependent. No system that I know of has this as a supported feature. Some have something that helps (e.g. BIND has rndc dumpdb

which will dump the current cache to a file). In any case, you will have to consult the documentation for your system.



Depending on why you want it, the least bad option might be to monitor the appropriate network interface for A and AAAA passes.

+1


source







All Articles