Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DnsServerScavenging: New resource proposal #189

Closed
johlju opened this issue Feb 27, 2021 · 0 comments · Fixed by #214
Closed

DnsServerScavenging: New resource proposal #189

johlju opened this issue Feb 27, 2021 · 0 comments · Fixed by #214
Labels
resource proposal The issue is proposing a new resource in the resource module.

Comments

@johlju
Copy link
Member

johlju commented Feb 27, 2021

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.

@johlju johlju added help wanted The issue is up for grabs for anyone in the community. resource proposal The issue is proposing a new resource in the resource module. labels Feb 27, 2021
@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Mar 20, 2021
johlju added a commit that referenced this issue Mar 22, 2021
- xDnsServer
  - Added new resource
    - _DnsServerScavenging_ - resource to enforce scavenging settings (issue #189).
  - Added the base class `ResourcePropertiesBase` to hold DSC properties that
    can be inherited for all class-based resources.
  - Added the base class `ResourceBase` to hold methods that should be
    inherited for all class-based resources.
  - Added new private function `ConvertTo-TimeSpan` to help when evaluating
    properties that must be passed as strings and then converted to `[System.TimeSpan]`.
  - Added `prefix.ps1` that is used to import dependent modules like _DscResource.Common_.
- DnsRecordBase
  - Changed class to inherit properties from 'ResourcePropertiesBase`.
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resource proposal The issue is proposing a new resource in the resource module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant