domain_cache
domain_cache
¶
IP-to-domain reverse lookup from the dnsmasq query log.
Parses reply / cached lines to build a mapping from resolved
IPs to their domain names. Used by shield watch and the
interactive session for NFLOG event enrichment.
DomainCache(state_dir)
¶
IP-to-domain reverse lookup cache.
Initialise with the dnsmasq log path derived from state_dir.
Source code in src/terok_shield/lib/watchers/domain_cache.py
lookup(ip)
¶
refresh()
¶
Reload the IP-to-domain mapping from the dnsmasq query log.
On OSError the previous cache is preserved.