NAME

Net::UKDomain::Nominet::Automaton - Module to handle the Nominet Automaton for domain registration and modification.

SYNOPSIS

use Net::UKDomain::Nominet::Automaton 
my $d = Net::UKDomain::Nominet::Automaton->new( keyid 	=> 'MYKEYID',
					passphrase 	=> 'HARDTOREMEMBER',
					tag 		=> 'ISPTAG',
					smtp		=> 'smtp.my.net',
					emailfrom	=> 'MyISP <domains@my.isp>',
					secring		=> '/path/to/secret/keyring',
					pubring		=> '/path/to/public/keyring',
					compat		=> 'PGP2',
					testemail	=> 'myown@email.here',
					);

my $domain = 'domain.sld.uk';

if ( ! $d->valid_domain($domain) ) {
	print "Invalid domain - " . $d->errstr;
	}

if ( ! $d->domain_available($domain) ) {
	print "Domain not available.";
	}

if ( ! $d->register($domain, \%details) ) {
	print "Unable to register domain - ". $d->errstr;
	}

if ( ! $d->modify($domain, \%details) ) {
	print "Unable to modify $domain - " . $d->errstr;
	}

if ( ! $d->query($domain) ) {
	print "Unable to query $domain - " . $d->errstr;
	}

if ( ! $d->renew($domain) ) {
	print "Unable to renew $domain - " . $d->errstr;
	}

if ( ! $d->release($domain, $othertag) ) {
	print "Unable to release $domain to $othertag - " . $d->errstr;
	}

if ( ! $d->delete($domain) ) {
	print "Unable to delete $domain - " . $d->errstr;
	}

DESCRIPTION

A simple module for the Nominet .UK email based automaton.

This is designed to allow you to handle all of the actions normally associated with registering and managing a .UK domain - ie checking that the proposed name is valid and available, registering it or modifying it.

Note that Nominet's Automaton is an asyncronous process. Requests are sent to it via email (using Net::SMTP) and it replies by email to the nofification email address Nominet hold on record for the tag holder.

Be warned that the error strings returned by the module are not intended to be returned directly to users of your script.

USAGE

Net::UKDomain::Nominet::Automaton has the following object based interface. On failure, all methods will return undef and set the errstr object with a suitable message.

Net::UKDomain::Nominet::Automaton->new( %args )

Constructs a new Net::UKDomain::Nominet::Automaton instance and returns that object. Returns undef on failure.

%args can include:

KEYID

The PGP or GPG key ID used to sign messages to the Nominet automaton.

PASSPHRASE

Your PGP passphrase

TAG

Your Nominet IPS TAG

SMTP

The smtp server through which messages to Nominet's automaton will be sent

EMAILFROM

The Email address from which messages to Nominet's automaton should be sent.

SECRING

The location of the secret keyring. This should be the absolute path to the file.

PUBRING

The location of the public keyring. This should be the absolute path to the file.

COMPAT

The compatibility mode for Crypt::OpenPGP.

TESTEMAIL

If you provide an email address here the PGP signed emails created will be sent to you and not to Nominet. Use this for debuging purposes but make sure you remember to remove it on live systems.

All arguements are required except COMPAT and TESTEMAIL. If COMPAT is not provided it will default to PGP2.

Net::UKDomain::Nominet::Automaton->valid_domain($domain);

Validates the domain for the .UK name space.

Net::UKDomain::Nominet::Automaton->domain_available($domain);

Checks whether the domain is available. Returns true if it is.

Net::UKDomain::Nominet::Automaton->register($domain, \%details);

Sends a message to the Nominet Automaton to register the domain.

The %details hash should contact all the registrant and other details for the registration using the standard Nominet Automaton field names.

The data will be verified for validity.

If the message is sent successfully returns true. Note that this does not confirm that the domain is actually registered. Nominet is an asynchronous registry so you need to check your email to confirm that the domain is registered. Your system should include a means of doing that and holding all the necessary details in some database.

Net::UKDomain::Nominet::Automaton->modify($domain, \%details);

Sends a message to the Automaton to modify the domain.

The %details hash should include only the fields you want to update. The fields need to be as per the Nominet Automaton standard fields.

Net::UKDomain::Nominet::Automaton->release($domain, $ipstag);

Releases the domain to the given IPS TAG.

This is the means Nominet use to transfer the management of a doamin from one TAG holder to another.

Net::UKDomain::Nominet::Automaton->renew($domain);

Renews the domain for the standard 2 year period.

Net::UKDomain::Nominet::Automaton->delete($domain);

Deletes the domain. There are limits on the use of this facility. See the Nominet website for more details.

Net::UKDomain::Nominet::Automaton->query($domain);

Sends a message to the Automaton requesting a listing of all of the details associated with the domain registration.

The data will be returned by email - it's an asyncronous registry.

EXPORT

None - use the object interface as set out above.

AUTHOR

Jason Clifford, <jason@ukpost.com>

SEE ALSO

http://www.jasonclifford.com/ http://www.nominet.org.uk/

perl.