DnsServerSetting: failed to execute `Set-TargetResource` functionality with error message: Generic failure
Details of the scenario you tried and the problem that is occurring
I am trying to set the ListenAddresses property. If no change is required, it runs successfully. However, if ListenAddress needs to be changed, it errors out. I've changed the IP addresses from their actual addresses.
Verbose logs showing the problem
Successful run:
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer DC1 with user sid
Failure:
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer DC1 with user sid
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
VERBOSE: [DC1]: LCM: [ End Set ] The SendConfigurationApply function did not succeed. + CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException + FullyQualifiedErrorId : MI RESULT 1 + PSComputerName : localhost
VERBOSE: Operation 'Invoke CimMethod' complete. VERBOSE: Time taken for configuration job to complete is 1.538 seconds
Suggested solution to the issue
The DSC configuration that is used to reproduce the issue (as detailed as possible)
# insert configuration here
configuration Sample_DnsSettings
{
Import-DscResource -ModuleName xDnsServer
node localhost
{
xDnsServerSetting DnsServerProperties
{
Name = 'DnsServerSetting'
ListenAddresses = '1.1.1.1'
Forwarders = '2.2.2.2','3.3.3.3'
NoRecursion = $false
LogLevel = 24865
AllowUpdate = 1
LogFilePath = 'C:\dns\dns.log'
}
}
}
Sample_DnsSettings
Start-DscConfiguration -Wait -Force -Path .\Sample_DnsSettings -Verbose
#### The operating system the target node is running
<!--
Please provide as much as possible about the target node, for example
edition, version, build and language.
On OS with WMF 5.1 the following command can help get this information.
Get-ComputerInfo -Property @(
'OsName',
'OsOperatingSystemSKU',
'OSArchitecture',
'WindowsVersion',
'WindowsBuildLabEx',
'OsLanguage',
'OsMuiLanguages')
-->
OsName : Microsoft Windows Server 2012 R2 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 9600.19321.amd64fre.winblue_ltsb_escrow.190313-1806
OsLanguage : en-US
OsMuiLanguages : {en-US}
#### Version and build of PowerShell the target node is running
<!--
To help with this information, please run this command:
$PSVersionTable
-->
PSVersion 5.1.14409.1018
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1018
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
#### Version of the DSC module that was used ('dev' if using current dev branch)
v1.11.0.0
I have the same issue with setting DNS Server IP in Windows Server 2019. All other setting take no issue, IP, Subnet, Default Gateway. Only DNS errors every time.
PowerShell DSC resource MSFT_DnsServerAddress failed to execute Set-TargetResource functionality with error message: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: A general error occurred that is not covered by a more specific error code. + CategoryInfo : InvalidOperation: (:) [], CimException + FullyQualifiedErrorId : ProviderOperationExecutionFailure + PSComputerName : localhost
This is error is generated by the ListenAddresses property.
The following error is generated when none of the specified IP addresses exist on a network interface. The resource should check available IP addresses on the node and throw an exception saying that neither IP address is available on a network interface.
PowerShell DSC resource MSFT_xDnsServerSetting failed to execute Set-TargetResource functionality with error message: Gener
ic failure
+ CategoryInfo : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : localhost
I see this when setting ListenAddress to a valid IP thats on the interface, but the DNS server is currently configured to 'All Addresses'
If I manually change the setting to the ip im trying to set it to, the DSC then updates correctly.
I cant see anyway to pass 'All IP Addreses' to the DSC listenaddresses option?
I see this when setting ListenAddress to a valid IP thats on the interface, but the DNS server is currently configured to 'All Addresses'
I can't reproduce this this. But in my lab it moves from AllIPAddresses setting to just using one (of two) IP addresses. But I did see that if having the GUI up, it needed a refresh to reflect the change.
I cant see anyway to pass 'All IP Addreses' to the DSC listenaddresses option?
It seems the read-only property here holds all the addresses (Get-DnsServerSetting -all).AllIPAddress but the resource does not currently support Get-DnsServerSetting (being tracked in issue #185).
Cheers, actually seeing some other strange things on a windows 2019 machine.
dnsserver throws an error about not being able to write to the log when puppet runs, however, the log it references is 'c:\windows%systemroot%\system32\DNS\dns.log' hardcoding this to 'c:\windows\system32\dns\dns.log stops the error (not sure whats going on here)
This machine has 2 forwarders configured, when passing in a comma seperated list of 6 it says it changed, but doesnt actually apply. Subsequent runs also show it doing corrective changes that again dont apply. This did work ok (at least showed no change) when run on a test machine with only 1 forwarder.
If I pull the powershell code out of a debug log I see this when running the invoke-dscresource with a -debug flag...
VERBOSE: [GNWSPRMGTADC02]: [[xDnsServerSetting]DirectResourceAccess] NOTMATCH: Value (type String[]) for property 'Forwarders' does have a different count. Current state count is '2' and desired state count is '1'
Shouldnt the desired count be 6?
I also see some dsc changes mentioning that forwarders and logfilepath are moved to their own dsc options (not sure what version actually get used here) https://github.com/dsccommunity/DnsServerDsc/releases
We're using puppetlabs-dsc 1.9.4
Just getting started with dsc so possibly missing something obvious.
Please open separate issues for other issues you are seeing so we don’t add things to this issue that are not related to ListeningIPAddresa.