# Advance Tcp/Ip DNS entries

**URL:** <https://discourse.chef.io/t/advance-tcp-ip-dns-entries/11404>\
**Category:** Chef Infra (archive)\
**Created:** [August 30, 2017, 1:46pm UTC](https://discourse.chef.io/t/advance-tcp-ip-dns-entries/11404 "2017-08-30T13:46:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prash](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@prash](https://discourse.chef.io/u/prash)\
**Post date:** [August 30, 2017, 1:46pm UTC](https://discourse.chef.io/t/advance-tcp-ip-dns-entries/11404/1 "2017-08-30T13:46:57Z")

</div>

Greetings Professionals

Is there any cookbook available that updates and enters the IP's , advance TCP/IP and DNS settings for windows servers?

Below is the Screenshot for which we need to update the New ips and settings accordingly for more than windows 100+ nodes is there any way to get this done through chef?

![image](https://sea2.discourse-cdn.com/flex016/images/transparent.png)

![image](https://sea2.discourse-cdn.com/flex016/images/transparent.png)

![image](https://sea2.discourse-cdn.com/flex016/images/transparent.png)

Please help..!

Thanks  
Prash

---

<div class="post-metadata">

**Author:** ![spuder](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/spuder/32/1382_2.png) [@spuder](https://discourse.chef.io/u/spuder)\
**Post date:** [August 30, 2017, 2:25pm UTC](https://discourse.chef.io/t/advance-tcp-ip-dns-entries/11404/2 "2017-08-30T14:25:42Z")

</div>

There are no native chef resources for managing DNS settings, however chef can manage powershell commands

Here is an example of how you might set your dns servers (code untested and likely wont work as is).

```
powershell_script 'set dns' do
  code 'Set-DNSClientServerAddress –interfaceIndex 12 –ServerAddresses ("10.0.0.1","10.0.0.2")'
  not_if "Get-DNSClientServerAddress -interfaceIndex 12 -eq "10.0.0.1" -and Get-DNSClientServerAddress -interfaceIndex 12 -eq "10.0.0.2"
  action :run
end

```

Note the `not_if` attribute that prevents chef from overwriting the settings if they are already in the desired state.

---

<div class="post-metadata">

**Author:** ![BobD](https://avatars.discourse-cdn.com/v4/letter/b/bcef8e/32.png) [@BobD](https://discourse.chef.io/u/BobD)\
**Post date:** [August 30, 2017, 2:32pm UTC](https://discourse.chef.io/t/advance-tcp-ip-dns-entries/11404/3 "2017-08-30T14:32:14Z")

</div>

We use the following cookbook for many of those settings on Windows - [https://supermarket.chef.io/cookbooks/network\_interfaces\_v2](https://supermarket.chef.io/cookbooks/network_interfaces_v2) - it works well for our needs.

~bob
