Ad blocking is popular but some connected devices are more noisy than others. Finding those devices that "phone home" less frequently can be difficult if it means filtering through the noise. I started a project to test out data classes, async/await and fill in a gap in my DNS sinkhole recon.
Using data classes and async/await functionality in Python 3.7 I query the Pi-hole web API (tested with Pi-hole FTL 4.0) to get a list of all requests currently in memory on the Pi-hole server. Using Counter from Collections I return a list of names encountered and the frequency at which they’ve been requested. Paring down the list to those encountered 100 times or less allows me to focus on sites forwarded to my upstream DNS server infrequently, highlighting ad sites I can block or potentially malicious traffic I may want to investigate.