Skip to content

Instantly share code, notes, and snippets.

@David-5-1
David-5-1 / dig.yml
Created May 30, 2023 13:08
Examples of dig lookup (weird) usage
- hosts: all
gather_facts: no
tasks:
- name: A & AAAA
debug:
msg: "{{ lookup('community.general.dig', 'sinquin.eu./A', 'sinquin.eu./AAAA') }}"
- name: A on multiple hosts
debug:
msg: "{{ lookup('community.general.dig', 'sinquin.eu.', 'aquaray.com') }}"
- name: AAAA with option
#!/usr/bin/python3
# WTFPL http://www.wtfpl.net/txt/copying/
import ipaddress
import sys
for range_ in sys.argv[1:]:
try:
print(*ipaddress.ip_network(range_, strict=False).hosts(), sep='\n')