Category Archives: Python

Python – Generate or Apply Rules For Iptables to Block DNS Queries Based on Domain Names

Posted on by 1 comment

This code will generate or apply rules for IPtables to block DNS queries based on domain names. I wrote this script because I did not want to manually convert each section of the domain into hex with their respective sizes every time I needed to block a random set of domains.

Example

Code

Category: Coding, Python