以编程方式检查域是否可用?

使用这个解决schemeBot? 检查一个域名是否可用? 我在C#中编写了一个快速脚本(粘贴在下面)来检查域MIGHT是否可用。 很多结果都拿出了域名。 它看起来像所有2个和3个字母.com域被采取,它看起来像所有3个字母被采取(不包括数量有很多可用)。 有一个命令或网站采取我的域名清单,并检查他们是否已注册或可用?

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Diagnostics; using System.IO; namespace domainCheck { class Program { static void Main(string[] args) { var sw = (TextWriter)File.CreateText(@"c:\path\aviliableUrlsCA.txt"); int countIndex = 0; int letterAmount=3; char [] sz = new char[letterAmount]; for(int z=0; z<letterAmount; z++) { sz[z] = '0'; } //*/ List<string> urls = new List<string>(); //var sz = "df3".ToCharArray(); int i=0; while (i <letterAmount) { if (sz[i] == '9') sz[i] = 'a'; else if (sz[i] == 'z') { if (i != 0 && i != letterAmount - 1) sz[i] = '-'; else { sz[i] = 'a'; i++; continue; } } else if (sz[i] == '-') { sz[i] = 'a'; i++; continue; } else sz[i]++; string uu = new string(sz); string url = uu + ".ca"; Console.WriteLine(url); Process p = new Process(); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardError = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.FileName = "nslookup "; p.StartInfo.Arguments = url; p.Start(); var res = ((TextReader) new StreamReader( p.StandardError.BaseStream)).ReadToEnd(); if (res.IndexOf("Non-existent domain") != -1) { sw.WriteLine(uu); if (++countIndex >= 100) { sw.Flush(); countIndex = 0; } urls.Add(uu); Console.WriteLine("Found domain {0}", url); } i = 0; } Console.WriteLine("Writing out list of urls"); foreach (var u in urls) Console.WriteLine(u); sw.Close(); } } } 

这是必须通过WHOIS完成的请求,他们依赖已发布的注册商条目。 一些顶级域名(如.to)不会公开WHOIS。 其他人,如.com.au,每个注册服务商都维护着自己的WHOIS,因此您需要找出该域注册了哪个注册服务商,然后查询他们的WHOIS。

另外,我使用的所有基于Web的WHOIS服务都具有validation码,完全可以阻止人们做你正在做的事情。 这是有很多原因的,其中一个很重要的就是阻止networking蹲点。

说到这一点,如果你打算用networking蹲:a)对你感到羞耻,b)在一些国家和TLD这实际上是非法的。

最后,所有这些说,有很多的C#的WHOIS组件。 这是我随机发现的。