DnsServerScavenging: New resource proposal
johlju opened this issue · comments
Description
Suggest adding a new resource that changes DNS server scavenging settings. Using the commands Get-DnsServerScavenging
and Set-DnsServerScavenging
.
Proposed properties
DnsServer
<Key, String> - The host name of the DNS server to change, or use'localhost'
for the current node.ScavengingState
<Write, Boolean> - Specifies whether to Enable automatic scavenging of stale records. ScavengingState determines whether the DNS scavenging feature is enabled by default on newly created zones.RefreshInterval
<Write, String> - Specifies the refresh interval as a value that can be converted to a TimeSpan object. During this interval, a DNS server can refresh a resource record that has a non-zero time stamp. Zones on the server inherit this value automatically.
If a DNS server does not refresh a resource record that has a non-zero time stamp, the DNS server can remove that record during the next scavenging. Do not select a value smaller than the longest refresh period of a resource record registered in the zone. The minimum value is 0. The maximum value is 8760 hours (seven days).ScavengingInterval
<Write, String> - Specifies a length of time as a value that can be converted to a TimeSpan object. ScavengingInterval determines whether the scavenging feature for the DNS server is enabled and sets the number of hours between scavenging cycles. The default setting is 0, which disables scavenging for the DNS server. A setting greater than 0 enables scavenging for the server and sets the number of days, hours, minutes, and seconds (formatted as dd.hh:mm:ss) between scavenging cycles. The minimum value is 0. The maximum value is 365.00:00:00 (1 year).NoRefreshInterval
<Write, String> - Specifies a length of time as a value that can be converted to a TimeSpan object. NoRefreshInterval sets a period of time in which no refreshes are accepted for dynamically updated records. Zones on the server inherit this value automatically. This value is the interval between the last update of a timestamp for a record and the earliest time when the timestamp can be refreshed. The minimum value is 0. The maximum value is 8760 hours (seven days).
Special considerations or limitations
The parameter ApplyOnAllZones
of the command Set-DnsServerScavenging
is not used since scavenging per zone should be enforce by another resource.
The parameters is strings that should be converted to TimeSpan
similar to the TTL
parameter here:
https://github.com/dsccommunity/xDnsServer/blob/dbcdb067ce905e7c3fc5f74d1ad787c3166f33ba/source/DSCResources/MSFT_xDnsRecordSrv/MSFT_xDnsRecordSrv.psm1#L200-L203
The parameter ScavengingState
should replace the property DefaultAgingState
in the resource xDnsServerSetting to avoid ping-pong behavior. The same goes for the properties ScavengingInterval
, DefaultNoRefreshInterval
, and DefaultRefreshInterval
in the resource xDnsServerSetting which will be replace by ScavengingInterval
, NoRefreshInterval
, and RefreshInterval
respectively. This can be done as part of the issue #185.