Search Again:

Re: Automating DNS - Again

From: Men & Mice Support
Date: Wednesday, January 5, 2000
Time: 7:37:00 am

At 10:33 PM -0800 1/4/2000, Jesse Williams Proudman wrote:
>Not sure if you remember me but here's my script to automate dns. Can you
>make this any quicker?
>
>tell application "QuickDNS Pro Admin"
> activate
> make new document
> set name of SOA of document 1 to "[domain]."
> set primary of SOA of document 1 to "ns1.ninewire."
> set admin of SOA of document 1 to "hostmaster@ninewire.com."
> make new NS record at end of document 1 with properties
>{name:"[domain].", server name:ns1.ninewire.com."}
> make new NS record at end of document 1 with properties
>{name:"[domain].", server name:"ns2.ninewire.com."}
> make new MX record at end of document 1 with properties
>{name:"[domain].", mailhost name:"revolution.ninewire.com.",
>preference:"10"}
> make new MX record at end of document 1 with properties
>{name:"[domain].", mailhost name:"twister.ninewire.com.", preference:"20"}
> make new A record at end of document 1 with properties
>{name:"[domain].", IP number:"209.43.195.246"}
> make new A record at end of document 1 with properties
>{name:"www.[domain].", IP number:"209.43.195.246"}
> make new A record at end of document 1 with properties
>{name:"mail.[domain].", IP number:"209.43.195.246"}
> close document 1 saving yes in file "Path:to:save:[domain]."
>end tell
>
>Any ideas? Thanks

No, I don't see how to make it any faster. What OS are you using? (Recent versions of AppleScript are considerably faster - 8.5 and later, as I recall.) You might try removing the "activate" step - this would save app switching time.

I do see some problems with the script. First, the obvious typo:
Line 5 (set admin...) - it should end with "ns1.ninewire.com.".

Aside from that, there is a problem of multithreadedness. For this reason, instead of address "document 1", change line 3 to this:
set theDomain to (make new document)
Then in your "set", "make", and "close" lines, address theDomain instead of document 1.
____________________________________________________________________
Chris Buxton cbuxton@menandmice.com
Men & Mice http://www.menandmice.com
Makers of: QuickDNS Pro



Messages In This Thread:



Return to Digital Point Solutions' Home Page