Actually the code you have is good you just seem to have over done it.
The first 3 lines seem to work fine (Although
GetHostByName
is obsolete). Then you ask the second 3 lines to resolve an IP address which fails. All you need is:
Dim hostname As IPHostEntry = Dns.GetHostEntry(TextBox3.Text)
Dim ip As IPAddress() = hostname.AddressList
TextBox3.Text = ip(0).ToString()