Tag Archives: Programming

Querying The Dac with PHP

I see the same thing over and over, and some people imply or suggest its easy or incredibly hard to connect and query/poll the Nominet DAC (Domain Availability Checker) to get basic data about a domain.

There are a few reasons you would want to do this, the main ones are to build a drop list database or build a drop catching script, but both are built on the same foundations.

Before you can use this, you need to be a Nominet Member, and have a DAC Subscription, but you can access the DAC Testbed for Free without Membership or Subscription.

I’m going to use a high level language for this example, which in this case is PHP, but Perl is faster, and a low level compiled language like C would be way way quicker, but PHP is more than adequate for database building and non-prime drop catching.

Basic Connect to and Poll the Dac

The above code will result in the following output, it really is as simple a half a dozen lines of code,.

You can now act upon the returned $resp variable, explode it into manageable chunks like…

This will return an array of 6 blocks numbered 0-5, which will be…

From here you can put it into a database…

Query a List of Names

Its most likely you would want to add some sort of loop to load a list of names…

Thats the basics covered where most people seem to strugle, its really endless where you can take a script.

I may revisit this code in future and expand on it, but for now, lets see what you do with it.

 

A Manchester Based Photographer and Website Developer with interests in Strongman, Fitness and Geekery.