Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

Getting a script to query DAC

Status
Not open for further replies.
Joined
Aug 23, 2005
Posts
813
Reaction score
9
After several late nights playing around with bits of code, I now have a working script, however..... It's programmed only to query whois.nic.uk - and it's doing it at a rate of 600 per minute.. I know.... I know.

For the time being I'm running it from the Command Line on my home PC (WinXP) and I obviously need to get it to query dac.nic.uk sooner rather than later.

Does anyone want to be festive and help me out abit?
 
So that you know - and if nominet are watching, I've slowed the queries down to 1 per second now.
 
if you are able to query the whois - querying the dac will actually be easier - just change your script to open a socket to dac.nic.uk port 2043 instead?
 
Thanks Jonno

I've tried that, but it doesn't work - Don't you have to telnet in or SSH or something - I got someone working on it, but it's a bit late for this weekend, it's unlikely Nominet would update my IP before the end of today and then they're not back till Tuesday

What are you using to connect?
 
just use ssh or command prompt:

Code:
telnet dac.nic.uk 2043[enter]
internet.co.uk[enter]
internet.co.uk,Y,N,N,1996-07-30,2006-07-30,1

etc...

:)
 
That's your script?

They look very much like manual entries to me - or am I missing something obvious?
 
that isn't my script - thats how to manually query the dac :)

to automate the process you need a script that will open a socket to dac.nic.uk:2043 and feed requests in automatically :)
 
That's what I thought - but it's not straight forward as changing whois.nic to dac.nic - there's different protocols to consider. I wish it was that easy - it's taken me 4 hours to find out how to slow the script down from 600+ requests per minute to 60 per minute. :)
 
Atlanta - what language are you programming in?
 
atlanta1 said:
After several late nights playing around with bits of code, I now have a working script, however..... It's programmed only to query whois.nic.uk - and it's doing it at a rate of 600 per minute.. I know.... I know.

For the time being I'm running it from the Command Line on my home PC (WinXP) and I obviously need to get it to query dac.nic.uk sooner rather than later.

Does anyone want to be festive and help me out abit?

if you are using perl.. you could use a socket to open your connection..
something like this will provide a basic TCP connection and run a single query to the DAC (on a unix box anyway).. merry xmas ;-)

Code:
#!/usr/bin/perl
use strict;
use IO::Socket;
	my $server = IO::Socket::INET->new(Proto => "tcp",
	                                   PeerPort => 2043,
	                                   PeerAddr => "dac.nic.uk",
	                                   Timeout => 20)
	                                   or die "failed to connect to the server\n";
			print $server "ext.co.uk\r\n";
		 	while ( <$server> )
		 	{
		 		print;
		 	}
 
atlanta1 said:
Perl - had to learn it all from scratch in a week

Aah, sorry, can't help then. PHP is my weapon of choice.

But it looks like Stevie has helped you out above.
 
As you're a PHP person, how can I query the normal one from a webpage? ie. whois.nic.uk?
 
TimRogers said:
As you're a PHP person, how can I query the normal one from a webpage? ie. whois.nic.uk?

Easiest way is to do this using the WHOIS web interface:

<?php

$url = "http://195.66.240.211/cgi-bin/whois.cgi?query=domain.co.uk";
$whois = file_get_contents($url);

?>

The output in the variable $whois will be the WHOIS for the domain name.
 
Secondly, how can you do a batch file where it opens the command, and it prompts you for the domain name to check, and then it prints the WHOIS?
 
or open a socket to whois.nic.uk port 43.

untested but should do the trick :)

Code:
<?php

$fp = fsockopen('whois.nic.uk', 43, $errno, $errstr);

if (!$fp) {

   echo "ERROR: $errno - $errstr<br />\n";

} else {

   fwrite($fp, "yahoo.co.uk\r\n");

   while (!feof($fp)) {

      echo str_replace("\n", '<br />', fread($fp, 100));

   }

   fclose($fp);
}

?>
 
How can I do a batch file one? I want it to query say google.co.uk every 5 minutes and if it's available send a popup saying so
 
TimRogers said:
How can I do a batch file one? I want it to query say google.co.uk every 5 minutes and if it's available send a popup saying so

my services are available for £75 an hour :)

alternatively - do some research! - we've helped you enough!
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Premium Members

New Threads

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom