Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obtain nameserver information for DNS lookups in Java

Tags:

java

dns

If I look up a IP address from a DNS name as follows:

InetAddress inetAddress = InetAddress.getByName(name);
String address = inetAddress.getHostAddress();

Can I find out which nameserver gave me the information?

like image 863
brabster Avatar asked Oct 29 '25 16:10

brabster


1 Answers

I'm not sure if this is what you want, but there's a DNSJava library which provides DNS functionality in Java. Perhaps you can use this to either get a better understanding of your issues, or to implement a particular solution ? Like I say, not a perfect match for you, but perhaps helpful.

like image 99
Brian Agnew Avatar answered Oct 31 '25 05:10

Brian Agnew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!