community.dns.reverse_pointer filter – Convert an IP address into a DNS name for reverse lookup
Note
This filter plugin is part of the community.dns collection (version 3.2.2).
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.dns
.
To use it in a playbook, specify: community.dns.reverse_pointer
.
New in community.dns 3.1.0
Synopsis
Given an IPv4 or IPv6 address, such as
192.168.1.2
, converts it to a DNS name to use for reverse lookups, such as2.1.168.192.in-addr.arpa
.
Input
This describes the input of the filter, the value before | community.dns.reverse_pointer
.
Parameter |
Comments |
---|---|
The IP address. |
See Also
See also
- RFC 1035, Section 3.5
Describes
in-addr.arpa
.- RFC 3152
Describes
ip6.arpa
.
Examples
- name: Convert IP address to DNS name for reverse lookup
ansible.builtin.set_fact:
dns_name: "{{ ip_address | community.dns.reverse_pointer }}"
# Should result in '2.1.168.192.in-addr.arpa.'
vars:
ip_address: 192.168.1.2
Return Value
Key |
Description |
---|---|
The DNS name. Returned: success |