community / community.dns / 2.8.3 / module / nameserver_record_info Look up all records of a type from all nameservers for a DNS name | "added in version" 2.6.0 of community.dns" Authors: Felix Fontein (@felixfontein)community.dns.nameserver_record_info (2.8.3) — module
Install with ansible-galaxy collection install community.dns:==2.8.3
collections: - name: community.dns version: 2.8.3
Given a DNS name and a record type, will retrieve all nameservers that are responsible for this DNS name, and from them all records for this name of the given type.
- name: Retrieve TXT values from all nameservers for two DNS names community.dns.nameserver_record_info: name: - www.example.com - example.org type: TXT register: result
- name: Show TXT values for www.example.com for all nameservers ansible.builtin.debug: msg: '{{ result.results[0].result }}'
name: description: - A list of DNS names whose nameservers to retrieve. elements: str required: true type: list type: choices: - A - ALL - AAAA - CAA - CNAME - DNAME - DNSKEY - DS - HINFO - LOC - MX - NAPTR - NS - NSEC - NSEC3 - NSEC3PARAM - PTR - RP - RRSIG - SOA - SPF - SRV - SSHFP - TLSA - TXT description: - The record type to retrieve. required: true type: str server: description: - The DNS server(s) to use to look up the result. Must be a list of one or more IP addresses. - By default, the system's standard resolver is used. elements: str type: list version_added: 2.7.0 version_added_collection: community.dns query_retry: default: 3 description: - Number of retries for DNS query timeouts. type: int query_timeout: default: 10 description: - Timeout per DNS query in seconds. type: float servfail_retries: default: 0 description: - How often to retry on SERVFAIL errors. type: int always_ask_default_resolver: default: true description: - When set to V(true) (default), will use the default resolver to find the authoritative nameservers of a subzone. See O(server) for how to configure the default resolver. - When set to V(false), will use the authoritative nameservers of the parent zone to find the authoritative nameservers of a subzone. This only makes sense when the nameservers were recently changed and have not yet propagated. type: bool
results: contains: name: description: - The DNS name this entry is for. returned: always sample: www.example.com type: str result: contains: nameserver: description: - The nameserver. returned: success sample: ns1.example.com type: str values: contains: address: description: - A IPv4 respectively IPv6 address. returned: if O(type=A) or O(type=AAAA) type: str algorithm: description: - The algorithm ID. returned: if O(type=DNSKEY) or O(type=DS) or O(type=NSEC3) or O(type=NSEC3PARAM) or O(type=RRSIG) or O(type=SSHFP) type: int altitude: description: - The altitude. returned: if O(type=LOC) type: float cert: description: - The certificate. returned: if O(type=TLSA) type: str cpu: description: - The CPU. returned: if O(type=HINFO) type: str digest: description: - The digest. returned: if O(type=DS) type: str digest_type: description: - The digest's type. returned: if O(type=DS) type: int exchange: description: - The exchange server. returned: if O(type=MX) type: str expiration: description: - The expiration Unix timestamp. returned: if O(type=RRSIG) type: int expire: description: - Number of seconds after which secondary name servers should stop answering request for this zone if the main name server does not respond. returned: if O(type=SOA) type: int fingerprint: description: - The fingerprint. returned: if O(type=SSHFP) type: str flags: description: - Flags. - This is actually of type C(string) for O(type=NAPTR). returned: if O(type=CAA) or O(type=DNSKEY) or O(type=NAPTR) or O(type=NSEC3) or O(type=NSEC3PARAM) type: int fp_type: description: - The fingerprint's type. returned: if O(type=SSHFP) type: int horizontal_precision: description: - The horizontal precision of the location. returned: if O(type=LOC) type: float inception: description: - The inception Unix timestamp. returned: if O(type=RRSIG) type: int iterations: description: - The number of iterations. returned: if O(type=NSEC3) or O(type=NSEC3PARAM) type: int key: description: - The key. returned: if O(type=DNSKEY) type: str key_tag: description: - The key's tag. returned: if O(type=DS) or O(type=RRSIG) type: int labels: description: - The labels. returned: if O(type=RRSIG) type: int latitude: description: - The location's latitude. elements: int returned: if O(type=LOC) type: list longitude: description: - The location's longitude. elements: int returned: if O(type=LOC) type: list mbox: description: - The mbox. returned: if O(type=RP) type: str minimum: description: - Used to calculate the TTL for purposes of negative caching. returned: if O(type=SOA) type: int mname: description: - Primary main name server for this zone. returned: if O(type=SOA) type: str mtype: description: - The mtype. returned: if O(type=TLSA) type: int next: description: - The next value. returned: if O(type=NSEC) or O(type=NSEC3) type: str order: description: - The order value. returned: if O(type=NAPTR) type: int original_ttl: description: - The original TTL. returned: if O(type=RRSIG) type: int os: description: - The operating system. returned: if O(type=HINFO) type: str port: description: - The port. returned: if O(type=SRV) type: int preference: description: - The preference value for this record. returned: if O(type=MX) or O(type=NAPTR) type: int priority: description: - The priority value for this record. returned: if O(type=SRV) type: int protocol: description: - The protocol. returned: if O(type=DNSKEY) type: int refresh: description: - Number of seconds after which secondary name servers should query the main name server for the SOA record to detect zone changes. returned: if O(type=SOA) type: int regexp: description: - A regular expression. returned: if O(type=NAPTR) type: str replacement: description: - The replacement. returned: if O(type=NAPTR) type: str retry: description: - Number of seconds after which secondary name servers should retry to request the serial number from the main name server if the main name server does not respond. returned: if O(type=SOA) type: int rname: description: - E-mail address of the administrator responsible for this zone. returned: if O(type=SOA) type: str salt: description: - The salt. returned: if O(type=NSEC3) or O(type=NSEC3PARAM) type: str selector: description: - The selector. returned: if O(type=TLSA) type: int serial: description: - Serial number for this zone. returned: if O(type=SOA) type: int service: description: - The service. returned: if O(type=NAPTR) type: str signature: description: - The signature. returned: if O(type=RRSIG) type: str signer: description: - The signer. returned: if O(type=RRSIG) type: str size: description: - The size of the location. returned: if O(type=LOC) type: float strings: description: - List of strings for this record. - See RV(results[].result[].values[].value) for the concatenated result. elements: str returned: if O(type=SPF) or O(type=TXT) type: list tag: description: - The tag. returned: if O(type=CAA) type: str target: description: - The target. returned: if O(type=CNAME) or O(type=DNAME) or O(type=NS) or O(type=PTR) or O(type=SRV) type: str txt: description: - The TXT value. returned: if O(type=RP) type: str type_covered: description: - The type covered. returned: if O(type=RRSIG) type: str usage: description: - The usage flag. returned: if O(type=TLSA) type: int value: description: - The value. - For O(type=SPF) or O(type=TXT), this is the concatenation of RV(results[].result[].values[].strings). returned: if O(type=CAA) or O(type=SPF) or O(type=TXT) type: str vertical_precision: description: - The vertical precision of the location. returned: if O(type=LOC) type: float weight: description: - The service's weight. returned: if O(type=SRV) type: int windows: description: - The windows. returned: if O(type=NSEC) or O(type=NSEC3) type: str description: - The records of type O(type). - Depending on O(type), different fields are returned. - For O(type=TXT) and O(type=SPF), also the concatenated value is returned as RV(results[].result[].values[].value). elements: dict returned: success sample: - address: 127.0.0.1 type: list description: - A list of values per nameserver. elements: dict returned: success sample: - nameserver: ns1.example.com values: - X - nameserver: ns2.example.com values: - X type: list description: - Information on the records for every DNS name provided in O(name). elements: dict returned: always sample: - name: www.example.com result: - nameserver: ns1.example.com values: - address: 127.0.0.1 - nameserver: ns2.example.com values: - address: 127.0.0.1 - name: example.org result: - nameserver: ns1.example.org values: - address: 127.0.0.1 - address: 127.0.0.2 - nameserver: ns2.example.org values: - address: 127.0.0.2 - nameserver: ns3.example.org values: - address: 127.0.0.1 type: list