Try
Dim ipEntry As IPHostEntry = Dns.GetHostByName(TextBox1.Text)
Dim IpAddr As IPAddress() = ipEntry.AddressList
Dim i As Integer
TextBox3.Text = IpAddr(0).ToString()
Dim hostname As IPHostEntry = Dns.GetHostEntry(TextBox1.Text)
Dim ip As IPAddress() = hostname.AddressList
TextBox3.Text = ip(0).ToString()
Catch ex As Exception
TextBox3.Text = ex.ToString()
End Try
Then you'll see what caused an exception I suppose. I am not VB.NET coder, so I cannot test the code.