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
相关问题
- Angular RxJS mergeMap types
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
If you need to query a specific nameserver to see how it is responding you can use the JNDI interface.
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 www.heise.de:
A = 193.99.144.85
AAAA = 2a02:2e0:3fe:100::7