How do i set the dns search suffix for a network adapter in .net?
-
03-07-2019 - |
Question
I've written a command line utility that detects which network interface is connected, and sets the staitc ip address and dns servers for it (by calling netsh). However, I can't seem to figure out how to set the dns search suffixes. netsh doesnt appear capable of doing that. How do I do that otherwise (WMI perhaps)?
Solution
I think you have to set the value(s) you want in the DNSDomainSuffixSearchOrder property of the Win32_NetworkAdapterConfiguration WMI object.
Here's and example of setting values in WMI, if you need it: Modifying Objects & Running Methods
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow