How to adjust TCP/IP settings (IP, DNS, etc)Greetings,<br> I am trying to find out how to change the DNS from &quot;Obtain DNS server address automatically&quot; to manual and enter the DNS address.<br> <br> Basically, what I want is the following:<br> 1. If computer ip address subnet is NOT  &quot;141.218.255.255&quot; then change the DNS setting to &quot;Obtain DNS server address autoamtically&quot;.  <br> <br> 2. and if it is &quot;141.218.255.255&quot; then make the DNS primary address &quot;141.218.1.92&quot; and secondary &quot;141.218.218.96&quot;<br> <br> Is there away to do this using System.Net?<br>© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Z353ad5d5-36c4-4f68-a26d-a99ea0d03ceahttp://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/353ad5d5-36c4-4f68-a26d-a99ea0d03cea#353ad5d5-36c4-4f68-a26d-a99ea0d03ceahttp://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/353ad5d5-36c4-4f68-a26d-a99ea0d03cea#353ad5d5-36c4-4f68-a26d-a99ea0d03ceamrayyanhttp://social.msdn.microsoft.com/Profile/en-US/?user=mrayyanHow to adjust TCP/IP settings (IP, DNS, etc)Greetings,<br> I am trying to find out how to change the DNS from &quot;Obtain DNS server address automatically&quot; to manual and enter the DNS address.<br> <br> Basically, what I want is the following:<br> 1. If computer ip address subnet is NOT  &quot;141.218.255.255&quot; then change the DNS setting to &quot;Obtain DNS server address autoamtically&quot;.  <br> <br> 2. and if it is &quot;141.218.255.255&quot; then make the DNS primary address &quot;141.218.1.92&quot; and secondary &quot;141.218.218.96&quot;<br> <br> Is there away to do this using System.Net?<br>Fri, 09 Jun 2006 15:20:06 Z2006-06-19T23:17:08Zhttp://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/353ad5d5-36c4-4f68-a26d-a99ea0d03cea#85ee8661-5317-4944-b1d7-5bd8147eabe5http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/353ad5d5-36c4-4f68-a26d-a99ea0d03cea#85ee8661-5317-4944-b1d7-5bd8147eabe5Brendan Granthttp://social.msdn.microsoft.com/Profile/en-US/?user=Brendan%20GrantHow to adjust TCP/IP settings (IP, DNS, etc)<p>Unfortunately this kind of functionality is still not supported by the framework... instead one very easy way to do such things is to pass the necessary arguments to an internally launched instance of <a title="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/netsh.mspx?mfr=true" href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/netsh.mspx?mfr=true">netsh</a>.</p> <p>When it comes to determining the current networks state however, if you are running the 2.0 Framework I would suggest looking into the <a title="http://msdn2.microsoft.com/en-US/library/system.net.networkinformation.aspx" href="http://msdn2.microsoft.com/en-US/library/system.net.networkinformation.aspx">NetworkInfromation</a> namespace and all of the gettable properties it provides.</p>Fri, 09 Jun 2006 15:41:08 Z2006-06-19T23:17:08Z