|
|
 |  |
Re: Delete a MX record from all zonesFrom: Men & Mice Support Date: Thursday, April 3, 2003
Time: 4:14:15 pmThe scripts included with QuickDNS Manager are intended to be used as examples.
Here's a quick and dirty script that should do roughly what you want:
____________________________________________________________________
tell application "QuickDNS Manager" -- adjust the application name as needed
set theZones to (the name of every zone)
repeat with theZone in theZones
set theZone to theZone as text
set theDoc to (open zone theZone)
tell theDoc
set theRecs to a reference to (every MX record whose name is "")
repeat with i from (count of theRecs) to 1 by -1
set theRec to a reference to item i of theRecs
set theMailHost to (the mailhost name of theRec) as string
if theMailHost does not end with "." then
set theMailHost to (theMailHost & "." & theZone)
end if
if the mailhost name of theRec is "the.old.mail.server." then
delete theRec
end if
end repeat
end tell
end repeat
end tell
____________________________________________________________________
The reason the loop has to count down from last to first is, if you
delete item 3 in a list, the next item, formerly item 4, is now item
3. However, item 2 remains item 2.
____________________________________________________________________
Chris Buxton Men & Mice
support@menandmice.com Making DNS Easy
At 4:52 PM -0400 4/3/03, Javier Galvez wrote:
>Hi,
>
>I would like to get an applescript for DELETING records from all zones.
>
>There is an applescript in SUPPORT installed within quickdns 3.5.3 that is
>called ADD RECORD TO ALL ZONES.
>
>What I need to do is DELETE a MX record from all zones.
>
>Please be kind to send me or guide me to any site that holds applescripts
>examples or complete solutions.
>
>Thank you a lot
>
>Javier Galvez
>MegaLink
>+(591)-715-22149
>jcgalvez@megalink.com
|

Return to Digital Point Solutions' Home Page |