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

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

  1. Thanks a lot, this was really usefull information

Leave a Reply

Your email address will not be published. Required fields are marked *