Add host and Domain Name

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