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.
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.
"Why don't you just use an API?"
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.
Previous Work
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
Any recommendation for improving detection is appreciated. This is my first question on SO, so forgive my verbosity and thanks for your precious time.