Advertisement
Guest User

lookupNS

a guest
Jul 27th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let lookupNS hostname =
  2.   let procInfo = ProcessStartInfo("nslookup",
  3.                                   sprintf "-querytype=NS %s" hostname,
  4.                                   RedirectStandardOutput=true,
  5.                                   RedirectStandardError=true,
  6.                                   UseShellExecute=false)
  7.   let result = Process.Start(procInfo).StandardOutput.ReadToEnd()
  8.   Regex.Matches(result, "nameserver\s+=\s+(?<ns>[\w-\.]*)")
  9.   |> Seq.cast<Match>
  10.   |> Seq.map(fun m -> m.Groups.Item("ns").Value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement