Code:
Public Function NDlookup(ByRef Domain As String, Optional Server As String = "localhost", Optional Address As String = "127.0.0.1")
Dim Proc As New Process
With Proc.StartInfo
.Arguments = Domain & Server & Address
.UseShellExecute = False
.RedirectStandardError = True
.FileName = "nslookup.exe"
.CreateNoWindow = True
.RedirectStandardOutput = True
End With
Try
Proc.Start()
If Proc.WaitForExit(8000) Then
'Returns Output
Return (Proc.StandardOutput.ReadToEnd)
Else
'Failed
Return ("TimeOut")
End If
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try
End Function
To use: