ansible.windows.win_dns_record_info module – Get Windows Server DNS records
Note
This module is part of the ansible.windows collection (version 3.9.1).
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 ansible.windows.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: ansible.windows.win_dns_record_info.
New in ansible.windows 3.10.0
Synopsis
List resource records in an existing Windows DNS zone or retrieve records by owner and type.
This module is read-only and supports check mode.
Requirements
The below requirements are needed on the host that executes this module.
The
DnsServerPowerShell module on the execution host.Permission to read the selected DNS server and zone.
Parameters
Parameter |
Comments |
|---|---|
The DNS server to query. When omitted, use the execution host’s local server. When using WinRM through another host, configure authentication that permits access to this server. |
|
The record owner relative to Use When omitted, query all owners in the zone. When no records match, |
|
The resource record type accepted by the DNS server, such as When omitted, query all record types. |
|
The existing DNS zone to query. A missing zone, access denial, or connection failure causes an error. |
|
The existing zone scope to query. When omitted, use the default scope. |
See Also
See also
- ansible.windows.win_dns_record
Manage Windows Server DNS records.
- ansible.windows.win_dns_zone
Manage Windows Server DNS Zones.
Examples
- name: List records in a zone
ansible.windows.win_dns_record_info:
zone: example.com
register: dns_records
- name: Get a host's IPv4 records from a selected server
ansible.windows.win_dns_record_info:
zone: example.com
name: database.example.com
type: A
computer_name: dns.example.com
register: database_records
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Whether any records matched the query. Returned: always Sample: |
|
Matching records sorted by owner, type, and value. Returned: always |
|
Whether the record has an aging timestamp. Returned: success Sample: |
|
Type-specific provider fields with IP addresses converted to strings and arrays preserved. Common fields use snake case, including Other provider field names are lowercased. Returned: success Sample: |
|
The owner relative to the zone. Returned: success Sample: |
|
Primary record values as strings for A, AAAA, CNAME, DHCID, NS, PTR, SRV, TXT, and MX records. TXT segments are joined into a single value. Other record types have an empty list; inspect Returned: success Sample: |
|
The provider timestamp in ISO 8601 format, or null for static records. Returned: success |
|
The time to live in seconds. Returned: success Sample: |
|
The resource record type. Returned: success Sample: |