GetHostEntry()不使用其他服务器或网络上的DNS [英] GetHostEntry() not working with DNS which are on other server or network

查看:64
本文介绍了GetHostEntry()不使用其他服务器或网络上的DNS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我有GetHostEntry() 用于检查给定IP或DNS主机名的方法是否存在。

 I have GetHostEntry()  method for checking given IP or DNS host name is exist or not.

它使用我网络上的所有ips和dns但不能使用不在我的网络上的ips 

its working with all ips and dns which are on my network but not working with ips which are not on my network 

否则有任何方法可以检查给定的IP或DNS是否存在。?

else is there any way to check Given Ip or DNS is exist or not.?

推荐答案

GetHostEntry使用与其他所有网络应用程序相同的机制。 如果你能"ping"名称或IP地址,然后GetHostEntry将找到它。 如果"ping"找不到它,那么这个名字就不存在了。

GetHostEntry uses the same mechanism as every other net application.  If you can "ping" the name or IP address, then GetHostEntry will find it.  If "ping" cannot find it, then the name does not exist.

没有可靠的方法来判断任意IP地址是否有效。 出于安全原因,许多有效的机器不响应ping。

There is no reliable way to tell whether an arbitrary IP address is valid.  Many valid machines do not respond to pings for security reasons.


这篇关于GetHostEntry()不使用其他服务器或网络上的DNS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆