dns_log
dns_log
¶
Tail the dnsmasq query log and emit events for blocked domain lookups.
Watches for new query[A] / query[AAAA] lines and classifies
each domain by suffix-matching against the merged allowed domain set
(profile + live - denied). Requires the dnsmasq DNS tier.
DnsLogWatcher(log_path, state_dir, container)
¶
Tail the dnsmasq query log and yield events for blocked domains.
Opens the log file, seeks to the end, and watches for new query lines.
Open log_path, seek to end, and load the initial allowed domain set.
Source code in src/terok_shield/lib/watchers/dns_log.py
fileno()
¶
close()
¶
poll()
¶
Read new lines and return events for blocked queries.