community.general.nsupdate module – Manage DNS records
Note
This module is part of the community.general collection (version 10.7.5).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.nsupdate.
Synopsis
- Create, update and remove DNS records using DDNS updates. 
Requirements
The below requirements are needed on the host that executes this module.
- dnspython 
Parameters
| Parameter | Comments | 
|---|---|
| Specify key algorithm used by  Choices: 
 | |
| Use TSIG key name to authenticate against DNS  | |
| Use this TCP port when connecting to  Default:  | |
| Sets the transport protocol (TCP or UDP). TCP is the recommended and a more robust option. Choices: 
 | |
| Sets the DNS record to modify. When zone is omitted this has to be absolute (ending with a dot). | |
| Apply DNS modification on this server, specified by IPv4 or IPv6 address. | |
| Manage DNS record. Choices: 
 | |
| Sets the record TTL. Default:  | |
| Sets the record type. Default:  | |
| Sets the record value. | |
| DNS record will be modified on this  When omitted DNS will be queried to attempt finding the correct zone. | 
Attributes
| Attribute | Support | Description | 
|---|---|---|
| Support: full | Can run in  | |
| Support: none | Will return details on what has changed (or possibly needs changing in  | 
Examples
- name: Add or modify ansible.example.org A to 192.168.1.1"
  community.general.nsupdate:
    key_name: "nsupdate"
    key_secret: "+bFQtBCta7j2vWkjPkAFtgA=="
    server: "10.1.1.1"
    zone: "example.org"
    record: "ansible"
    value: "192.168.1.1"
- name: Add or modify ansible.example.org A to 192.168.1.1, 192.168.1.2 and 192.168.1.3"
  community.general.nsupdate:
    key_name: "nsupdate"
    key_secret: "+bFQtBCta7j2vWkjPkAFtgA=="
    server: "10.1.1.1"
    zone: "example.org"
    record: "ansible"
    value: ["192.168.1.1", "192.168.1.2", "192.168.1.3"]
- name: Remove puppet.example.org CNAME
  community.general.nsupdate:
    key_name: "nsupdate"
    key_secret: "+bFQtBCta7j2vWkjPkAFtgA=="
    server: "10.1.1.1"
    zone: "example.org"
    record: "puppet"
    type: "CNAME"
    state: absent
- name: Add 1.1.168.192.in-addr.arpa. PTR for ansible.example.org
  community.general.nsupdate:
    key_name: "nsupdate"
    key_secret: "+bFQtBCta7j2vWkjPkAFtgA=="
    server: "10.1.1.1"
    record: "1.1.168.192.in-addr.arpa."
    type: "PTR"
    value: "ansible.example.org."
    state: present
- name: Remove 1.1.168.192.in-addr.arpa. PTR
  community.general.nsupdate:
    key_name: "nsupdate"
    key_secret: "+bFQtBCta7j2vWkjPkAFtgA=="
    server: "10.1.1.1"
    record: "1.1.168.192.in-addr.arpa."
    type: "PTR"
    state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
| Key | Description | 
|---|---|
| 
 Returned: always Sample:  | |
| 
 Returned: always Sample:  | |
| DNS record. Returned: success Sample:  | |
| DNS record TTL. Returned: success Sample:  | |
| DNS record type. Returned: success Sample:  | |
| DNS record value(s). Returned: success Sample:  | |
| DNS record zone. Returned: success Sample:  | 
