- Docs »
- nsupdate - Manage DNS records.
-
You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
nsupdate - Manage DNS records.
The below requirements are needed on the host that executes this module.
Parameter |
Choices/Defaults |
Comments |
key_algorithm
|
Choices:
- HMAC-MD5.SIG-ALG.REG.INT
hmac-md5 ←
- hmac-sha1
- hmac-sha224
- hmac-sha256
- hmac-sha384
- hmac-sha512
|
Specify key algorithm used by key_secret .
|
key_name
|
|
Use TSIG key name to authenticate against DNS server
|
key_secret
|
|
Use TSIG key secret, associated with key_name , to authenticate against server
|
port
(added in 2.5) |
Default:
53
|
Use this TCP port when connecting to server .
|
record
required |
|
Sets the DNS record to modify.
|
server
required |
|
Apply DNS modification on this server.
|
state
|
Choices:
present ←
- absent
|
Manage DNS record.
|
ttl
|
Default:
3600
|
Sets the record TTL.
|
type
|
Default:
"A"
|
Sets the record type.
|
value
|
|
Sets the record value.
|
zone
required |
|
DNS record will be modified on this zone .
|
- name: Add or modify ansible.example.org A to 192.168.1.1"
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"
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
nsupdate:
key_name: "nsupdate"
key_secret: "+bFQtBCta7j2vWkjPkAFtgA=="
server: "10.1.1.1"
zone: "example.org"
record: "puppet"
type: "CNAME"
state: absent
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
changed
string
|
success |
If module has modified record
|
dns_rc
int
|
always |
dnspython return code
Sample:
4
|
dns_rc_str
string
|
always |
dnspython return code (string representation)
Sample:
REFUSED
|
record
string
|
success |
DNS record
Sample:
ansible
|
ttl
int
|
success |
DNS record TTL
Sample:
86400
|
type
string
|
success |
DNS record type
Sample:
CNAME
|
value
list
|
success |
DNS record value(s)
Sample:
192.168.1.1
|
zone
string
|
success |
DNS record zone
Sample:
example.org.
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Hint
If you notice any issues in this documentation you can edit this document to improve it.