It is easiest if you never add the duplicate result:
vb Code:
  1. 'get the contents of the file
  2.         Dim data As String = IO.File.ReadAllText("DNSLog.txt")
  3.         'get something to store the results in for display
  4.         Dim result As New System.Text.StringBuilder
  5.         'create the pattern to match by
  6.         Dim pattern As String = "[a-zA-Z0-9\.]+\.(com|net|org|info|edu|de|biz|tv|us|co|uk|eu)"
  7.         'loop through all matches and add them to the results to be displayed
  8.         For Each m As System.Text.RegularExpressions.Match In System.Text.RegularExpressions.Regex.Matches(data, pattern)
  9.             'check if the result is already part of the results
  10.             If Not result.ToString.Contains(String.Format("{1}{0}", Environment.NewLine, m.Value)) Then
  11.                 'only add new result if it is not a duplicate
  12.                 result.AppendFormat("{1}{0}", Environment.NewLine, m.Value)
  13.             End If
  14.         Next
  15.         'display the results
  16.         MsgBox(result.ToString)