Ansible/ubuntu/dns-flush.yaml

8 lines
227 B
YAML

- name: Flush DNS Cache on Remote Hosts
hosts: all
become: yes # Requires root privileges
tasks:
- name: Flush DNS cache using resolvectl (for systemd-resolved)
ansible.builtin.command: resolvectl flush-caches