Given a domain and a nameserver ip I’d like to know where is that nameserver resolving the IP in java, how can I achieve it? Thanks
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have at least two options:
If your code has to run on any VM, you must use one of the many available Java DNS libraries. Googling for “java dns library” will give you many options.
If your code is only going to run on a Sun/Oracle VM, you can use the proprietary JNDI DNS provider like this:
This example will query the specified DNS server for all A and AAAA records for the host http://www.heise.de:
A = 193.99.144.85
AAAA = 2a02:2e0:3fe:100::7