How to block dns requests from google (8.8.8.8) and level3 (4.2.2.1, etc)?
I tried this with iptables but nothing happens:
iptables -A INPUT -s 8.8.8.8 -j DROP iptables -A OUTPUT -d 8.8.8.8 -j DROP iptables -A INPUT -s 8.8.4.4 -j DROP iptables -A OUTPUT -d 8.8.4.4 -j DROP iptables -A INPUT -s 4.2.2.1 -j DROP iptables -A OUTPUT -d 4.2.2.1 -j DROP iptables -A INPUT -s 4.2.2.2 -j DROP iptables -A OUTPUT -d 4.2.2.2 -j DROP iptables -A INPUT -s 4.2.2.3 -j DROP iptables -A OUTPUT -d 4.2.2.3 -j DROP iptables -A INPUT -s 4.2.2.4 -j DROP iptables -A OUTPUT -d 4.2.2.4 -j DROP iptables -A INPUT -s 4.2.2.5 -j DROP iptables -A OUTPUT -d 4.2.2.5 -j DROP iptables -A INPUT -s 4.2.2.6 -j DROP iptables -A OUTPUT -d 4.2.2.6 -j DROP
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Empty your iptables rules using <br><pre>iptables -F <br>iptables -X</pre> <br>and try to block the port and ip with <br><pre>iptables -A INPUT -i eth0 -p tcp --destination-port 53 -s 8.8.8.8 -j DROP</pre>
I just remembered that there is also in /etc/network/interfaces for Ubuntu/Debian. You can remove the last line <br>dns-nameservers 8.8.4.4 8.8.8.8 209.244.0.3
Port 53 was blocked and /etc/network/interfaces also was configured with other DNS nameservers, but still receiving google and level 3 nameservers. <br> <br>
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.