E
E
Ernest Farukshin2019-08-20 15:07:07
Java
Ernest Farukshin, 2019-08-20 15:07:07

Why does getHostName return an IP address and not a hostname?

Why does getHostName return an IP address and not a hostname?

InetAddress inetAddress = InetAddress.getByName("93.186.225.193");
   System.out.println(inetAddress.getHostName());

Outputs: 93.186.225.193
And should: vk.com

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-08-20
@Ernest3

There is no PTR record defined for this address, so reverse DNS lookup is not possible.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question