1

I'm creating a template for a client who wishes to quickly check the availability of dozens of domains at a time. The template must remain as an excel file.

I've installed and used the SEOToolsForExcel which permitted me to query a server and check whether particular domains are available using the isdomainregistered() function. Unfortunately however, the function will always return 'true' (i.e. domain is taken) for all Australian ('.com.au') domains that are thrown at it. I've tried changing the TLD lookup in the xml config file as suggested in this page : http://seotoolsforexcel.com/how-to-setup-tlds-in-seotools-config-xml/

I tried with the following:

<Tld Name="au" WhoIsServer="whois.aunic.net" WhoIsNotFoundRegex="(no match)|(no data found)|(not found)|(no entries found)|(error for)|(invalid pattern)|(illegal question)" WhoIsCreatedRegex="" WhoIsUpdatedRegex="(?:Last Modified:\s*(\d{2}-[A-z]{3}-)\d{4})" WhoIsExpiresRegex="" WhoIsDelayMs="1000" />

and this one:

<Tld Name="au" WhoIsServer="whois-check.ausregistry.net.au" WhoIsNotFoundRegex="is free" WhoIsCreatedRegex="" WhoIsUpdatedRegex="" WhoIsExpiresRegex="" WhoIsDelayMs="1000" />

But neither seemed to have worked. I've checked with other services that clearly show that the domains are available, yet the SEOTool keeps returning false results (only on '.com.au' domains, '.com' domains work fine).

Thus, my next attempt is to code a custom function in excel to take the domain and send it through to the Ausregistry.com.au server's domain-availability tool.

Ausregistry explains how this can be done in their page here:http://www.ausregistry.com.au/tools/domain-availability

They explain:

The service will then respond with either the string 'Available' or 'Not Available' depending upon the availability of the Domain Name.

For Example

To check the availability of ausregistry.net.au follow these steps:

  • Connect to: Address: whois-check.ausregistry.net.au, Port: 43

  • Send the string `ausregistry.net.au\r\n' to the server

  • The server will respond with `Not Available' and then close the connection.

The above procedure is compatible with standard WHOIS protocol; hence any reseller interface that is built to use WHOIS will be able to use this system as well. Alternatively, the standard *nix whois command can be used as follows: whois -h

I've coded plenty in VBA before but I do not know how to implement this connection to the server and how to throw it the domain string and then read the result. I'd appreciate any information on how to achieve this using VBA.

caracter2
  • 43
  • 7
  • I'd be surprised if this is possible. You should be able to write a PERL or Python script or just use an existing utility that does Whois lookups. – Lumigraphics Aug 14 '15 at 12:51

1 Answers1

0

Update. I solved this issue months ago and figured I would post my solution in case anyone stumbles across this. @Lumigraphics, thankfully I didn't have to learn PERL. I used the OstroSoft Winsock Component (you can get it here).

And the following UDF:

Function AusRegDomainAvailable(DomainUrl As String) As Boolean
Dim sPage As String
Dim sServer As String
Dim nPort As Long
Dim AusRegistryServer As String
Dim ReturningData As String
Dim wsTCP As OSWINSCK.Winsock
Dim FixedDomain As String
Dim Timelimit As Date

QueryTimeOut = False


FixedDomain = Replace(DomainUrl, "www.", "")
FixedDomain = Replace(FixedDomain, "http://", "")
FixedDomain = Replace(FixedDomain, "https://", "")
AusRegistryServer = "whois-check.ausregistry.net.au"
nPort = 43
sServer = Trim(AusRegistryServer)
If InStr(sServer, "://") > 0 Then sServer = Mid(sServer, InStr(sServer, "://") + 3)
If InStr(sServer, "/") > 0 Then
    sPage = Mid(sServer, InStr(sServer, "/") + 1)
    sServer = Left(sServer, InStr(sServer, "/") - 1)
End If
If InStr(sServer, ":") > 0 Then
    nPort = Mid(sServer, InStr(sServer, ":") + 1)
    sServer = Left(sServer, InStr(sServer, ":") - 1)
End If
If sServer = "" Then Err.Raise 12001, , "Invalid URL"

Set wsTCP = CreateObject("OSWINSCK.Winsock")
wsTCP.Connect sServer, nPort

Do Until wsTCP.State = 7
    DoEvents
    If wsTCP.State = sckError Then
        Exit Function
    End If
Loop

wsTCP.SendData FixedDomain & vbCrLf
Timelimit = (Now + TimeValue("0:00:02"))

Do Until wsTCP.Status = "Data Arrival" Or Now > Timelimit
    DoEvents
    If wsTCP.State = sckClosed Then
        QueryTimeOut = True
        Exit Function
    End If
Loop

wsTCP.GetData ReturningData

ReturningData = Replace(ReturningData, vbLf, "")
ReturningData = Replace(ReturningData, vbCr, "")
ReturningData = Trim(ReturningData)

If ReturningData = "Available" Then
    AusRegDomainAvailable = True
ElseIf ReturningData = "Not Available" Then
    AusRegDomainAvailable = False
Else
    QueryTimeOut = True
    AusRegDomainAvailable = Null
End If

DoEvents

Debug.Print FixedDomain & " " & ReturningData
wsTCP.CloseWinsock
Exit Function

ErrHandler:
    AusRegDomainAvailable = "Error " & Err.Number & ": " & Err.Description
End Function
caracter2
  • 43
  • 7