如何知道域名在vb.net中指向的位置

时间:2012-03-14 04:37:59

标签: vb.net dns

例如,如果我ping google.com,我得到了:

使用32个字节的d ping google.com [173.194.38.130] 来自173.194.38.130的回复:bytes = 32 time = 1033ms TTL = 56 来自173.194.38.130的回复:bytes = 32 time = 1004ms TTL = 56 来自173.194.38.130的回复:bytes = 32 time = 518ms TTL = 56

这意味着google.com指向173.194.38.130

如何使用vb.net?

1 个答案:

答案 0 :(得分:1)

最佳选择是使用Dns.GetHostEntry方法。

Dim hostNameOrAddress As String = "google.com"
Dim returnValue As IPHostEntry

returnValue = Dns.GetHostEntry(hostNameOrAddress)

More info