DNS::WorldWideDns - An interface to the service.


 use DNS::WorldWideDns;
 $dns = DNS::WorldWideDns->new($user, $pass);
 $hashRef = $dns->getDomains;
 $hashRef = $dns->getDomain($domain);
 $dns->updateDomain($domain, $properties);


This module allows you to dynamically create, remove, update, delete, and report on domains hosted at It makes working with their sometimes obtuse, but very useful, DNS API protocol ( a breeze.


The following methods are available from this class:

addDomain ( domain, [ isPrimary, isDynamic ] )

Adds a domain to your account. Throws MissingParam, InvalidParam, InvalidAccount and RequestError.

NOTE: You should use updateDomain() directly after adding a domain to give it some properties and records.

Returns a 1 on success.


A domain to add.


A boolean indicating if this is a primary domain, or a secondary. Defaults to 1.

NOTE: This module currently only supports primary domains.


A boolean indicating whether this domain is to allow Dynamic DNS ip updating. Defaults to 0.

deleteDomain ( domain )

Removes a domain from your account. Throws MissingParam, InvalidParam, InvalidAccount and RequestError.

Returns a 1 on success.


A domain to delete.

getDomain ( domain, [ nameServer ] )

Retrieves the zone information about the domain. Throws MissingParam, InvalidParam, InvalidAccount and RequestError.

Returns a hash reference structure that looks like this:

    hostmaster      => "",
    refresh         => "86400",
    retry           => "1200",
    expire          => "186400",
    ttl             => "3600",
    secureTransfer  => "*",
    records         => []

The hostmaster field is the email address of the person in charge of this domain. Note that it should use dot notation, so don't use an at (@) sign.

The refresh field tells a cache name server how often (in seconds) to request fresh data from the authoratative name server. Minimum 3600.

The retry field tells a cache name server how long to wait (in seconds) before attempting to retry a failed refresh. Minimum 3600.

The expire field tells a cache name server how old (in seconds) to let data become before discarding it. Minimum 3600.

The ttl (Time To Live) is the default value for records that don't have a TTL specified.

The secureTransfer parameter is an access control list for zone transfers. Asterisk (*) implies that anyone can do zone transfers. Otherwise it could be a list of IP addresses separated by spaces. Setting it to an empty string means no servers may do zone transfers on the domain.

The records field is an array reference of records attached to this domain. It looks something like this:

        name    => "smtp",
        ttl     => 3600,
        type    => "A",
        data    => ""
        name    => "@",
        ttl     => 3600,
        type    => "MX",
        data    => "10"

The name field is the subdomain or host name that will be prepended on to the domain. For example the "www" in "". The at (@) symbol means the domain itself, which is why you can type not just The asterisk (*) is a wildcard, which means if no matching records are found, use this record to service the request.

The ttl field tells a caching name server how long (in seconds) it may use this record before it has to fetch new information about it. Minimum 3600.

The type field is the domain record type defined in RFC1035. Common record types are A, CNAME, an MX.

The data field holds the data of the record. It's usually an ip address or a fully qualified host name.


A domain to request information about.


Defaults to 1. Choose from 1, 2, or 3. The number of the primary, secondary or tertiary name server.

getDomains ( )

Returns a hash reference where the key is the domain and the value is either a 'Primary' or an 'Secondary'. Throws InvalidAccount and RequestError.

NOTE: This module does not currently handle creating, reading, or updating secondary domains, but it may in the future, so this indicator is left in.

makeRequest ( url, [ request ] )

Makes a GET request. Returns the HTTP::Response from the request. Throws MissingParam, InvalidParam, InvalidAccount and RequestError.

NOTE: Normally you never need to use this method, it's used by the other methods in this class. However, it may be useful in subclassing this module.


The URL to request.


Normally an HTTP::Request object is created for you on the fly. But if you want to make your own and pass it in you are welcome to do so.

new ( username, password )

Constructor. Throws MissingParam.


Your username.


The password to go with username.

password ()

Returns the password set in the constructor.

updateDomain ( domain, params )

Updates a domain in your account. Throws MissingParam, InvalidParam, InvalidAccount and RequestError.

Returns a 1 on success.


A domain to update.


A hash reference identical to the one returned by getDomain().

username ()

Returns the username set in the constructor.


This module uses Exception::Class for exception handling. Each method is capable of throwing one or more of the following exceptions:


A general undefined error.


An expected parameter to a method was not passed.


A parameter passed in doesn't match what was expected. This add a "got" field to the exception which contains what was received.


Authentication to failed.


Some part of the request/response to did not go as expected. This adds url, response, and code fields to the exception.

The url field is the URL that was requested. This can be very helpful when debugging a problem.

The response field is the HTTP::Response object that was returned from the request.

The code field is the error code number or numbers that were returned by the API. More informationa about them can be found in the DNS API protocol documentation pages (


None known.


This module is not feature complete with the API provides. It does your basic CRUD and that's it. They have other methods this doesn't use, and they have a whole reseller API which this doesn't support. If you need those features, patches are welcome.


    JT Smith
    Plain Black Corporation


This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.