Domains

  • Thread starter Thread starter Terry Burns
  • Start date Start date
T

Terry Burns

I know this is a little off topic but you guys are the best and i know
somebdoy out there will have the answer to my question :

I need to know how to find out all the domain names on the internet or if
thats not possible a method of determining
a domain name from any given ip address.
 
Using Visual Studio 2005, put two text boxes and one command button on a
form and use this code. It will handle either a name or a numeric IP
address

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Windows.Forms.Cursor.Current = Cursors.WaitCursor
'first determine if a numeric Ip address or a name
Dim txtSearch As String = "", Result As String = ""
If IsNumeric(Replace(Trim(Me.TextBox1.Text), ".", "")) Then
txtSearch = Trim(Me.TextBox1.Text)
Dim host As System.Net.IPHostEntry
Try
host = System.Net.Dns.GetHostEntry(txtSearch)
Result = host.HostName.ToString
Catch ex As Exception
Windows.Forms.Cursor.Current = Cursors.Default
MsgBox(ex.Message)
End Try
Else 'need to change the host name into a numeric IP address
Dim host As System.Net.IPHostEntry
Try
host = System.Net.Dns.GetHostEntry(Trim(Me.TextBox1.Text))
Catch ex As Exception
Windows.Forms.Cursor.Current = Cursors.Default
MsgBox(ex.Message)
Exit Sub
End Try

Result = host.AddressList(0).ToString
End If
Me.TextBox2.Text = Result
Windows.Forms.Cursor.Current = Cursors.Default
End Sub
 
Back
Top