How can you check whether domain exists or not in Java?

前端 未结 5 1226
死守一世寂寞
死守一世寂寞 2020-12-17 20:57

Suppose my email address is xyz@yahoo.com and I want to check if yahoo.com is a valid domain or not.

Can anyone tell me which Java API I ca

5条回答
  •  醉话见心
    2020-12-17 21:02

    I don't know if it's the best way to this, but I've done something similar for a VB.NET program:

    I just pinged the domain, and if I didn't get a reply, the domain either was offline or didn't exist.

提交回复
热议问题