read

Stop DNS Hijacking


Disclaimer

It may be a bad idea to run DNS over Tor, unless you’re being DNS hijacked. USE IT AT YOUR OWN RISK.


  1. Check that you are able to access Tor network, if Tor is blocked by your ISP, use Tor bridges.
  2. Add the following line line to your torrc configuration file
    DNSPort 127.0.0.1:5335
  3. Restart Tor
  4. Change your computer DNS address to point to 127.0.0.1
  5. Run iptables to forward DNS requests to 5335/udp
    iptables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 5335
    iptables -t nat -I OUTPUT -p udp -o lo --dport 53 -j REDIRECT --to-ports 5335
  6. save iptables rules
    iptables-save > /etc/iptables/iptables.rules
  7. enable and start iptables.service
    systemctl enable iptables.service
    systemctl start iptables.service

Warning : if you stopped Tor, you have to change your DNS address to a DNS provider instead of 127.0.0.1
Warning : You may need to restart Tor if your internet connection dropped

Stay safe.

Blog Logo

NourEddineX


Published

Image

N!

Bypassing..

Back to Overview