# Add host and Domain Name

**URL:** https://discourse.chef.io/t/add-host-and-domain-name/10834
**Category:** Chef Automate
**Created:** [April 25, 2017, 2:54pm UTC](https://discourse.chef.io/t/add-host-and-domain-name/10834 "2017-04-25T14:54:04Z")
**Posts on this page:** 1
**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: [April 25, 2017, 2:54pm UTC](https://discourse.chef.io/t/add-host-and-domain-name/10834/1 "2017-04-25T14:54:04Z")

</div>

Greetings Professionals,

Help…

add the host entry

I’m trying to update C:\Windows\System32\drivers\etc\hosts and my recipe is

hostsfile\_entry ‘10.0.xxxx’ do  
hostname 'WIN-C7UA0CTGF78.am.ad.npc’  
unique true  
end

i have to automate this we have like 50 windows server i need to update the host name for every machine is there any command that chef could automatically pull the host and domain name and update that on hosts file?

i tried using community cookbooks but that dosent gave me the result “i may be wrong in config part but still need pros help on this”

Thanks  
Prash
