Set DNS = CreateObject("TCPIP.DNS") On Error Resume Next ip = DNS.GetIPByHost("www.microsoft.com") host = DNS.GetHostByIP(ip) If Err <> 0 Then 'some dns error - host not found, ... End If On Error Goto 0