title: How can you change Network settings (IP Address, DNS, WINS, Host Name) with code in C#
body: <p>I am developing a wizard for a machine that is to be used as a backup of other machines.  When it replaces an existing machine, it needs to set its IP address, DNS, WINS, and host name to match the machine being replaced.</p>
  
  <p>Is there a library in .net (C#) which allows me to do this programatically?</p>
  
  <p>There are multiple NICs, each which need to be set individually.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Thank you <a href="https://stackoverflow.com/questions/209779/how-can-you-change-network-settings-ip-address-dns-wins-host-name-with-code-in-c#209822">TimothyP</a> for your example.  It got me moving on the right track and the quick reply was awesome.</p>
  
  <p>Thanks <a href="https://stackoverflow.com/questions/209779/how-can-you-change-network-settings-ip-address-dns-wins-host-name-with-code-in-c#209983">balexandre</a>.  Your code is perfect.  I was in a rush and had already adapted the example TimothyP linked to, but I would have loved to have had your code sooner.</p>
  
  <p>I've also developed a routine using similar techniques for changing the computer name.  I'll post it in the future so subscribe to this questions <a href="https://stackoverflow.com/feeds/question/209779" title="RSS Feed">RSS feed</a> if you want to be informed of the update.  I may get it up later today or on Monday after a bit of cleanup.</p>