community / community.dns / 2.8.3 / module / nameserver_info Look up nameservers for a DNS name | "added in version" 2.6.0 of community.dns" Authors: Felix Fontein (@felixfontein)community.dns.nameserver_info (2.8.3) — module
Install with ansible-galaxy collection install community.dns:==2.8.3
collections: - name: community.dns version: 2.8.3
Retrieve all nameservers that are responsible for a DNS name.
- name: Retrieve name servers of two DNS names community.dns.nameserver_info: name: - www.example.com - example.org register: result
- name: Show nameservers for www.example.com ansible.builtin.debug: msg: '{{ result.results[0].nameserver }}'
name: description: - A list of DNS names whose nameservers to retrieve. elements: str required: true type: list 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 resolve_addresses: default: false description: - Whether to resolve the nameserver names to IP addresses. type: bool 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 nameservers: description: - A list of nameservers for this DNS name. elements: str returned: success sample: - ns1.example.com - ns2.example.com type: list description: - Information on the nameservers for every DNS name provided in O(name). elements: dict returned: always sample: - name: www.example.com nameservers: - ns1.example.com - ns2.example.com - name: example.org nameservers: - ns1.example.org - ns2.example.org - ns3.example.org type: list