xNetworking DNS not setting static DNS Address

Has any successfully used xDnsServerAddress from the xNetworking resource? I believe I’ve got my configuration correct, but it doesn’t change the setting. It also doesn’t throw any errors. Below are the results from the test and set for the resource and the config.

VERBOSE: [ZDC01]:                            [[xDNSServerAddress]DnsServerAddress] Test-TargetResource: Checking the DNS Server Addresses.
VERBOSE: [ZDC01]:                            [[xDNSServerAddress]DnsServerAddress] Test-TargetResource: DNS Servers are not correct. Expected "System.String[]", actual "System.String
[]".
VERBOSE: [ZDC01]: LCM:  [ End    Test     ]  [[xDNSServerAddress]DnsServerAddress]  in 0.6880 seconds.
VERBOSE: [ZDC01]: LCM:  [ Start  Set      ]  [[xDNSServerAddress]DnsServerAddress]
VERBOSE: [ZDC01]:                            [[xDNSServerAddress]DnsServerAddress] Set-TargetResource: Applying the DNS Server Addresses.
VERBOSE: [ZDC01]:                            [[xDNSServerAddress]DnsServerAddress] Set-TargetResource: DNS Servers are already set correctly.
VERBOSE: [ZDC01]: LCM:  [ End    Set      ]  [[xDNSServerAddress]DnsServerAddress]  in 0.0780 seconds.

https://gist.github.com/Duffney/9f4ee947ecb64f71f77c

I think it wants an array of strings.

I’ll try inserting that instead and see what happens, I got it to work just fine with cNetworking. Appreciate the reply thank you.

I have it working just fine with an array of strings, but you’re not the first to modify xNetworking and replace it with cNetworking. I’ve made a custom module on more than one occasion for clients because the IP address is an “add” and not a “replace” (NIC will end up with two IPs if a differing fixed IP is already present).

Keep telling myself I’ll fork and try to commit back to github but never got around to it. Just add an optional “replace” parameter to let you change the behavior.

Thank you both for the responses, Don was right it needed an array of strings not just a string or an object. Something that should also be looked at, time to learn more about Github and pull requests :slight_smile: I got it working by replacing my configdata with the below.

https://gist.github.com/Duffney/57389407a1d047f96696