Simple DNS Plus API documentation

(c) by NeoKobe 2005

All rights reserved.

Please visit www.neokobe.nl for info

========================================================================

The API consists of 2 classes:

	- zone
	- sdnsAPI
	
	
	
ZONE class

A zone is a full description for your zone. Zone properties are:

    domainName 
    primaryNS 
    secondaryNS 
    SOATTL					(default: 86400)
    minimumTTL				(default: 3600)
    refresh					(default: 86400)
    retry					(default: 3600
    expire					(default: 777600
    hostmasterName			(default: hostmaster)
    webserverIP 
    ftpserverIP 
    mailServerIP 
    mailServerHostname 
    mailserverPriority 
    otherCnames 
    otherHosts 
    
The zone class has an empty constructor. Just create an instance by:

	dim myZone = new zone

Then you'll be able to set all props like the domainname, the nameservers, etc.


SDNSAPI class

This is the main API interface. The props:

	lastMessage (contains last message returned from SDNS)
	adminPass (the password to your http interface)
	sdnsHost (your primary simple dns host)
	remoteport (default to 8053)
	
It has 2 new constructors

	dim x as new sdnsNetApi(hostname, remoteport)
	dim x as new sdnsNetApi(hostname, password, [remoteport])
	
The available functions:

	-----------------------------------------------------------------------------------------
	Clears cache: 
	
		sdpApi.clearCache()

	-----------------------------------------------------------------------------------------
	Deletes A record "sub" for domain "yourdomain.com"
	You must supply a valid host, otherwise this will fail (duh):
	
		sdpApi.delete_A_Record("sub.yourdomain.com")

	-----------------------------------------------------------------------------------------
	Returns status as string:
	
		sResponse = sdpApi.getStatus()

	-----------------------------------------------------------------------------------------
	Returns zoneinformation for "mydomain.com" as string:
	
		sResponse = sdpApi.getZone("mydomain.com")

	-----------------------------------------------------------------------------------------
	Returns the zonelist as string, zones are seperated by CRLF (vbCrLF or \r\n)
	You can choose between simple, primary (only primary zones), secondary (only
	Secondary zones) or extended.:
	
		sResponse = sdpApi.getZoneList(sdnsNetAPI.ZoneListTypes.simple)

	-----------------------------------------------------------------------------------------
	LastMessage property contains the last message generated by Simple DNS Plus
	This may come in useful when you experience troubles as errors are also
	mentioned.:
	
		sResponse = sdpApi.lastMessage()
		
	-----------------------------------------------------------------------------------------
	Reload all zones from disk:
	
		sdpApi.reloadAllFromDisk()

	-----------------------------------------------------------------------------------------
	Udates or inserts the A record "sub" and points it to IP "80.80.80.80"
	The zone "yourdomain.com" should already exist(!):
	
		sdpApi.update_A_Record("sub.yourdomain.com", "80.80.80.80")

	-----------------------------------------------------------------------------------------
	Inserts a new zone using a Zone object. The "yourzone" use here should
	be an instance of the Zone class and should have all required properties.
	
		sdpApi.updatePrimaryZone(yourZone)
	
	-----------------------------------------------------------------------------------------
	Inserts a new zone by inserting all information in "theZoneAsString" 
	into the nameserver for the zone "yourdomain.com". Please refer to a
	.dns zone file in your Simple DNS Plus data directory to find out
	about the structure of the zone information. Keep in mind that you
	should format the string "theZoneAsString" exactly as Simple DNS Plus
	does it. Which means you need to format with all Tabs, CrLf's, etc.:
	
		sdpApi.updatePrimaryZone("yourdomain.com", theZoneAsString)

	-----------------------------------------------------------------------------------------
	Inserts a new zone for "yourdomain.com" and sets NS records to 
	ns1.yournameserver.com and ns2.yournameserver.com. Also the A record
	for yourdomain.com is set to "80.80.80.80". Furthermore the following
	default settings will be used:
	SOA TTL:                       86400 seconds
	Email of responsible person:   hostmaster@yourdomain.com
	Refresh:                       86400 seconds
	Retry:                         3600 seconds
	Expire:                        777600 seconds
	Minimum TTL:                   3600 seconds
	A MX record will be made:      MX, priority 10, with "mail.yourdomain.com" as host
	
	Both "ftp.yourdomain.com" and "mail.yourdomain.com" A records will be made 
	(using given IP "80.80.80.80") "www.yourdomain.com" cname will be made to be 
	alias for "yourdomain.com":
	
		sdpApi.updatePrimaryZone("yourdomain.com", "ns1.yournameserver.com", "ns2.yournameserver.com", "80.80.80.80")

	-----------------------------------------------------------------------------------------
	Inserts a new zone for "yourdomain.com" and does exactly the same settings
	(both user and default) as the previous example. On top of that it also
	creates all CNAMES and A records you supply.
	You may supply CNAME and A records by seperating "alias" and "data"
	by a whitespace and each record by a colon (,).

	Example for CNAMES (input as string):
	"webmail @, members @" will create the CNAME "webmail.yourdomain.com" for "yourdomain.com" and
	another CNAME "members.yourdomain.com" also for "yourdomain.com"

	Example for A records (input as string):
	"pop 80.80.80.81, smtp 80.80.80.82" will create an A record "pop.yourdomain.com" which will point 
	to "80.80.80.81" and another A record "smtp.yourdomain.com" which will point to "80.80.80.82"

	Additional info: as the default CNAME "mail.yourdomain.com" is already being made, you cannot
	use this alias yourself, and thus it will be skipped if found.:

		sdpApi.updatePrimaryZone("yourdomain.com", "ns1.yournameserver.com", "ns2.yournameserver.com", "80.80.80.80", "webmail @, members @", "pop 80.80.80.81, smtp 80.80.80.82")
