BREAKING CHANGE: DnsServerSetting: Switch to use `Get-DnsServerSetting` and `Set-DnsServerSetting`
johlju opened this issue · comments
Details of the scenario you tried and the problem that is occurring
Currently this resource can change forwarders, so can the resource xDnsServerForwarder. This can result in a ping-pong behavior when both resources are used in the same configuration and sets two different desired states,
Verbose logs showing the problem
Not available.
Suggested solution to the issue
Instead of using CIM to change the settings, the xDnsServerSetting resource should use Get-DnsServerSetting
and Set-DnsServerSetting
. Using those cmdlet it will remove the property Forwarders from the resource xDnsServerSetting and make sure that only xDnsServerForwarder can be used for this task.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
Configuration xDnsServerSetting_CurrentNode_Config
{
Import-DscResource -ModuleName 'xDnsServer'
Node localhost
{
xDnsServerSetting 'DnsServerProperties'
{
DnsServer = 'localhost'
Forwarders = @('168.63.129.16', '168.63.129.18')
}
xDnsServerForwarder 'SetForwarders'
{
IsSingleInstance = 'Yes'
IPAddresses = @('168.63.129.16', '192.168.0.11')
UseRootHint = $false
}
}
}
The operating system the target node is running
All Windows.
Version and build of PowerShell the target node is running
Windows PowerShell 5.1
Version of the DSC module that was used
Code in main
There is also work in issue #189 that should be done when working on this issue.
Should have a property to sett all IP addresses using (Get-DnsServerSetting -all).AllIPAddress
.
There are three properties in the current implementation that are not part of Get-DnsServerSetting -All
or any other cmdlet, or any other property in another cmdlet (that I can find at least). Maybe these properties are not used any longer? These can only be set through the class MicrosoftDNS_Server.
Properties:
- DisjointNets
- IsSlave
- LogLevel
Suggest moving these properties to a resource DnsServerSettingLegacy
so it is easier to remove these in the future, or move to a suitable resource when there might belong. Also since one of the properties using an offensive word, I suggest renaming the resource parameter it in the DSC resource to NoForwarderRecursion
(we can't do anything about the underlying class).
It seems that the property EnableRegistryBoot
is replaced by BootMethod
, so leaving EnableRegistryBoot
out of the new resource.
Source: