Visual C# Developer Center > Visual C# Forums > Visual C# General > How to adjust TCP/IP settings (IP, DNS, etc)
Ask a questionAsk a question
 

AnswerHow to adjust TCP/IP settings (IP, DNS, etc)

  • Friday, June 09, 2006 3:20 PMmrayyan Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Greetings,
    I am trying to find out how to change the DNS from "Obtain DNS server address automatically" to manual and enter the DNS address.

    Basically, what I want is the following:
    1. If computer ip address subnet is NOT  "141.218.255.255" then change the DNS setting to "Obtain DNS server address autoamtically". 

    2. and if it is "141.218.255.255" then make the DNS primary address "141.218.1.92" and secondary "141.218.218.96"

    Is there away to do this using System.Net?

Answers

  • Friday, June 09, 2006 3:41 PMBrendan GrantModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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 netsh.

    When it comes to determining the current networks state however, if you are running the 2.0 Framework I would suggest looking into the NetworkInfromation namespace and all of the gettable properties it provides.

All Replies

  • Friday, June 09, 2006 3:41 PMBrendan GrantModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    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 netsh.

    When it comes to determining the current networks state however, if you are running the 2.0 Framework I would suggest looking into the NetworkInfromation namespace and all of the gettable properties it provides.