# Playbook to manage bind dynamic zone

**URL:** <https://forum.ansible.com/t/playbook-to-manage-bind-dynamic-zone/9677>\
**Category:** Get Help\
**Tags:** playbook\
**Created:** [October 4, 2024, 1:17pm UTC](https://forum.ansible.com/t/playbook-to-manage-bind-dynamic-zone/9677 "2024-10-04T13:17:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keyzer\_Suze](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/keyzer_suze/32/4833_2.png) [@Keyzer\_Suze](https://forum.ansible.com/u/Keyzer_Suze)\
**Post date:** [October 4, 2024, 1:17pm UTC](https://forum.ansible.com/t/playbook-to-manage-bind-dynamic-zone/9677/1 "2024-10-04T13:17:22Z")

</div>

Hi

new to ansible, i have bind setup on local network with 1 zone setup for dynamic update - this is connected to my dhcp server - its working.

now I have some static entries i want in there and I would like ansible to manage it.

I think this is the module i’m looking for [community.general.nsupdate module – Manage DNS records — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/collections/community/general/nsupdate_module.html)

so I create a directory create a ansible.cfg and create a host file to corrospond to that. entered an object that points to my server that bind.

In the example for the module it looks like I have to create an entry for each record and it looks like it about 10 lines big is that right. if I have 10 A records and 10 cnames do I need 20 tasks, is there some way to create a list / array and have the same task run for each element ?

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [November 23, 2024, 9:37pm UTC](https://forum.ansible.com/t/playbook-to-manage-bind-dynamic-zone/9677/2 "2024-11-23T21:37:18Z")

</div>

Use one or more [loops](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html) to apply the updates, you might need more than one as different updates will have a different arguments, for example removing a record won’t need a `value` but adding or modifying one will.
