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.1.0).

You might already have this collection installed if you are using the ansible package. 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 as 2.1.168.192.in-addr.arpa.

Input

This describes the input of the filter, the value before | community.dns.reverse_pointer.

Parameter

Comments

Input

string / required

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

Return value

string

The DNS name.

Returned: success

Authors

  • Felix Fontein (@felixfontein)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.