Name resolution / Ping utilities Version 1.5

Category:
Network/Internet
Type:
Modules
Difficulty:
Advanced

Author: Richard Deeming

Version Compatibility: Visual Basic 5

More information:
This module contains IP utilities, including functions to ping an IP host and resolve an IP host name, given the IP address. Version 1.5, posted to this site on 10/02/2000, also includes a function for reverse DNS lookup (i.e., retrieve the host name given the IP address).

Example: If you try to open an inaccessible FTP site with the InternetOpen method, you will have to wait for a couple of minutes for the code to time out. If you use this module to try to resolve the URL (or proxy-server name) to an IP address, and then ping it first, this can be reduced to a couple of seconds., EG:

strIP = GetIPAddress("ftp.microsoft.com")
If Ping(strIP, strRTT, fDM) = 0 Then 'IP_SUCCESS
If fDM Then
'Ping was successful
MsgBox "Successfully pinged ftp.microsoft.com (" & strIP &") in " & strRTT

Else
'Returned data didn't match
'Ping failed
End If
Else
'Ping failed
End If


Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.

Download ip_utils.zip