xNetworking DNS not setting static DNS Address

This topic contains 4 replies, has 3 voices, and was last updated by Profile photo of Duffney Duffney 1 year, 6 months ago.

  • Author
  • #34217
    Profile photo of Duffney

    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.

  • #34266
    Profile photo of Don Jones
    Don Jones

    I think it wants an array of strings.

  • #34483
    Profile photo of Duffney

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

  • #34500
    Profile photo of Justin King
    Justin King

    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.

  • #34543
    Profile photo of Duffney

    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 🙂 I got it working by replacing my configdata with the below.

You must be logged in to reply to this topic.