A Python module to resolve IP addresses from an SPF (Sender Policy Framework) DNS record. Returns a set of IPv4 and IPv6 addresses for the given domain. Version 1.0.5, stable release.
pip install spf2ipVerified import paths — ran on the pinned version, not inferred.
Retrieve all IP addresses authorized by the SPF record for a domain.
Use sorted(ips) or list(ips) if order is needed.
Wrap call in try-except for spf2ip.exceptions.DNSError or general Exception.
Manually verify against authoritative SPF for large domains.