Note
This filter plugin is part of the community.dns collection (version 3.3.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.get_public_suffix.
New in community.dns 0.1.0
This describes the input of the filter, the value before | community.dns.get_public_suffix.
Parameter | Comments |
|---|---|
Input string / required | A DNS name. |
This describes keyword parameters of the filter. These are the values key1=value1, key2=value2 and so on in the following example: input | community.dns.get_public_suffix(key1=value1, key2=value2, ...)
Parameter | Comments |
|---|---|
icann_only boolean | This controls whether only entries from the ICANN section of the Public Suffix List are used, or also entries from the Private section. For example, Choices:
|
keep_leading_period boolean | This controls whether the leading period of a public suffix is preserved or not. Choices:
|
keep_unknown_suffix boolean | This treats unknown TLDs as valid public suffixes. So for example the public suffix of This option corresponds to whether the global wildcard rule Choices:
|
normalize_result boolean | This controls whether the result is reconstructed from the normalized name used during lookup. During normalization, ulabels are converted to alabels, and every label is converted to lowercase. For example, the ulabel Choices:
|
- name: Extract the public suffix from a DNS name
ansible.builtin.set_fact:
public_suffix: "{{ 'www.ansible.co.uk' | community.dns.get_public_suffix }}"
# Should result in '.co.uk'
Key | Description |
|---|---|
Return value string | The public suffix. Returned: success |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/dns/get_public_suffix_filter.html