title: VBA Function to connect to WHOIS server and return availability of a .com.au domain
body: <p>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.</p>
  
  <p>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 : <a href="http://seotoolsforexcel.com/how-to-setup-tlds-in-seotools-config-xml/" rel="nofollow">http://seotoolsforexcel.com/how-to-setup-tlds-in-seotools-config-xml/</a></p>
  
  <p>I tried with the following:</p>
  
  <pre><code>&lt;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" /&gt;
  </code></pre>
  
  <p>and this one:</p>
  
  <pre><code>&lt;Tld Name="au" WhoIsServer="whois-check.ausregistry.net.au" WhoIsNotFoundRegex="is free" WhoIsCreatedRegex="" WhoIsUpdatedRegex="" WhoIsExpiresRegex="" WhoIsDelayMs="1000" /&gt;
  </code></pre>
  
  <p>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).</p>
  
  <p>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. </p>
  
  <p>Ausregistry explains how this can be done in their page here:<a href="http://www.ausregistry.com.au/tools/domain-availability" rel="nofollow">http://www.ausregistry.com.au/tools/domain-availability</a></p>
  
  <p>They explain:</p>
  
  <blockquote>
    <p>The service will then respond with either the string 'Available' or 'Not Available' depending upon the availability of the Domain Name.</p>
    
    <p><strong>For Example</strong> </p>
    
    <p>To check the availability of ausregistry.net.au follow these steps:</p>
    
    <ul>
    <li><p>Connect to: Address: whois-check.ausregistry.net.au, Port: 43</p></li>
    <li><p>Send the string `ausregistry.net.au\r\n' to the server</p></li>
    <li>The server will respond with `Not Available' and then close the connection.</li>
    </ul>
    
    <p>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  </p>
  </blockquote>
  
  <p>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.</p>