how to make reverse dns lookup in Java

前端 未结 2 1767
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-06 10:32

I have a list of IPs. I need to make reveres DNS, i.e, I want the website name.

I tried the following:

InetAddress addr = InetAddress.getByName(\"98.         


        
2条回答
  •  没有蜡笔的小新
    2021-01-06 11:13

    The IP Address in the code your provided resolves to yahoo because it is held by yahoo.

    The Ip address you are using is designated for only one host. As you can imagine yahoo probably has thousands of servers. They get assigned an allocation of ipaddresses which they then reuse as they see fit for internal allocation. The different servers under yahoo domain have different names and hence when you reference an ip address from a specific server you get the name for that specific server. For the general ipaddress for yahoo.com that might be hidden unless you want to to a nslookup and query a whole range of ipaddress to find yahoo.com allocations and generalize from there.

提交回复
热议问题