Thank you for this. I think I have a bit of a dilemma. I use Pi-hole as my DNS server and the names are not gettign logged here. This may not beable to work with my setup. When I ran the script ands started streaming I got zero output.dnsmasq logging needs to be enabled. You can use these instructions to set it up.
https://github.com/Xentrk/x3mRouting#enable-dnsmasq-logging
I will update the code to prompt the user if they want the script to perform the dnsmasq.log setup if it doesn't exist. Need a day or two though.