.co.za 域的 SOA DNS 记录的快速并发检查 [英] Fast concurrent checking of SOA DNS records for .co.za domains

查看:24
本文介绍了.co.za 域的 SOA DNS 记录的快速并发检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望通过检查 SOA 的存在来尽可能准确地实施 .co.za 域名的批量可用性检查,或者MX 记录使用 C# ASP.NET.

I want to implement bulk availability checking of .co.za domain names as accurately as possible by checking for the existence of SOA or MX records using C# ASP.NET.

我正在寻找一种解决方案,该解决方案可以正确利用线程一次检查至少 10 个域的方式检查相关 DNS 记录.

I am looking for a solution that can check for the relevant DNS records in a way that properly utilises threading to check at least 10 domains at a time.

检查 .co.za 域可用性的唯一真正准确的方法是使用 http://co.za/whois.shtml,但陈旧的 WHOIS 服务不允许批量检查并限制对给定 IP 的连续检查.

The only truly accurate way of checking the availibility of a .co.za domain is to use http://co.za/whois.shtml, but the archaic WHOIS service does not allow bulk checking and limits consecutive checks for a given IP.

迄今为止,我通过使用我古老的经典 ASP 脚本,利用 Emmanuel Kartmann 称为简单 DNS 解析器"的旧 DNS 库,获得了相当准确的结果.但是,这种方法不能很好地扩展,我需要能够使用正确线程化的 ASP.NET 实现来处理更多用户.

To date, I have gotten fairly accurate results by using my ancient classic ASP script utilising an old DNS library called "Simple DNS Resolver" by Emmanuel Kartmann. However, this approach does not scale well and I need to be able to handle more users with a properly threaded ASP.NET implementation.

我现在使用的顽皮代码如下所示:

The naughty code I'm using right now looks something like this:

Dim oDNS, pDomain, found_names

Set oDNS = CreateObject("Emmanuel.SimpleDNSClient.1")

oDNS.ServerAddresses = "127.0.0.1" // Set DNS server to use
oDNS.Separator = "," // Set separator for found_names multiple outputs

为每个域执行以下操作:

Execute the following for each domain:

Err.Clear // Reset error flag. I know, I hate it too.

oDNS.Resolve pDomain, found_names, "C_IN", "T_SOA" // Look for SOA records for domain

If Err <> 0 Then // No SOA records could be found.
    Err.Clear // Reset error flag
    oDNS.GetEmailServers pDomain, found_names // Look for MX records
    If Err <> 0 Then // No MX records found either
        AssumeDomainIsAvailable(pDomain);
    Else // Found some MX records
        DomainUnavailable(pDomain);
    End If

Else // Found some SOA records
    DomainUnavailable(pDomain);
End If

对于改进检测的任何建议表示赞赏.这是我关于 SO 的第一个问题,所以请原谅我的冗长并感谢您的宝贵时间.

Any recommendation for improving detection is appreciated. This is my first question on SO, so forgive my verbosity and thanks for your precious time.

推荐答案

使用 JH Software 的 .NET 的 DNS 客户端库:

This would be very easy using JH Software's DNS Client Library for .NET:

var Response = JHSoftware.DnsClient.Lookup("example.com", 
                              JHSoftware.DnsClient.RecordType.SOA);

它还支持用于异步查找的 BeginLookup/EndLookup 方法.

It also supports BeginLookup / EndLookup methods for asynchronous lookups.

这篇关于.co.za 域的 SOA DNS 记录的快速并发检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆