DataLife Engine / How to redirect DNS traffic in Linux

How to redirect DNS traffic in Linux


If you use Linux as a router (gateway) for users to Internet access, then you can control user requests by redirecting DNS traffic to your DNS server.

To do this, just do the following:

Add rules to nat table:
iptables -t nat -I PREROUTING -p udp --dport 53 -j DNAT --to 192.168.55.53:53
iptables -t nat -I PREROUTING -p tcp --dport 53 -j DNAT --to 192.168.55.53:53
iptables -t nat -I PREROUTING -p udp --dport 5353 -j DNAT --to 192.168.55.53:53
12-07-2022, 18:15
Вернуться назад