Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

How to use a script to set DNS cache attributes on your ISA Server 2004 computer


View products that this article applies to.

Introduction

In Microsoft Internet Security and Acceleration (ISA) Server 2004, you can use a script to set the attributes of the Domain Name System (DNS) cache. You can use a script to set the DnsCacheNegativeTtl property, the DnsCacheRecordMaxKB property, and the DnsCacheSize property of the FPCLowLevelSettings object without manually editing the registry.

Note The FPCLowLevelSettings object is an ISA Server Admin COM object.

↑ Back to the top


More information

The following Microsoft Visual Basic Scripting Edition (VBScript) code displays the current values of the DnsCacheNegativeTtl property, of the DnsCacheRecordMaxKB property, and of the DnsCacheSize property on the local ISA Server computer.
' Create the root object.
Dim root
Set root = CreateObject("FPC.Root")
 
'Declare the other objects that are necessary.
Dim array       ' An FPCArray object
Dim settings    ' An FPCLowLevelSettings
 
' Get references to the array object and to the low-level 
' settings object.
Set array = root.GetContainingArray
Set settings = array.ArrayPolicy.LowLevelSettings
 
WScript.Echo "DNS cache settings:" & vbCrLf & _ 
             "  TTL of entries for unsuccessful lookups: " & _
                settings.DnsCacheNegativeTtl & vbCrLf & _
             "  Maximum size of a single record: " & _
                settings.DnsCacheRecordMaxKB & vbCrLf & _
             "  Maximum size of the Firewall service DNS cache: " & _
                settings.DnsCacheSize
The following VBScript code sets a new value for the DnsCacheNegativeTtl property:
' Create the root object.

Dim root
Set root = CreateObject("FPC.Root")

'Declare the other objects that are necessary.

Dim Policy       ' An FPCArrayPolicy object

' Get an array policy object and set the new value of the
' DnsCacheNegativeTtl property of the low-level 
' settings object.    

Set Policy = root.GetContainingArray.ArrayPolicy
Policy.LowLevelSettings.DnsCacheNegativeTtl = 7200

Policy.Save

WScript.Echo "Done!"
You can edit the sample VBScript code to set a new value for the DnsCacheRecordMaxKB property and for the DnsCacheSize property.

Note These scripts do not have error checking or error handling.

↑ Back to the top


More information

For more information, see the ISA Server Software Development Kit (SDK) documentation.

↑ Back to the top


Keywords: KB843127, kbinfo, kbfirewall

↑ Back to the top

Article Info
Article ID : 843127
Revision : 3
Created on : 7/16/2004
Published on : 7/16/2004
Exists online : False
Views : 360