Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the domain names according to an IP address by coding (Java)?

Former Member
0 Kudos

The scenario is: we want to do security check on received emails. Now we can get the IP addresses of the email server, but how can we get their domain names such as company.com by coding such as Java?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Qiwei Yin,

You may use InetAddress class from java.net package.

It has special method (getCanonicalHostName()), which you can use to obtain domain name from the host with the known IP address.

Award the points if it answers your question

Best regards,

Laziz

1 REPLY 1

Former Member
0 Kudos

Hi Qiwei Yin,

You may use InetAddress class from java.net package.

It has special method (getCanonicalHostName()), which you can use to obtain domain name from the host with the known IP address.

Award the points if it answers your question

Best regards,

Laziz