Can we redirect DNS (tcp/udp) requests to Squid proxy in non-transparent mode (3128) using iptables? (Would the squid proxy understand this and process it?)
example rule to redirect tcp 53 (It could be another similar):
iptables -t nat -A PREROUTING -s 192.168.0.0/24 -i eth1 -p tcp --dport 53 -j REDIRECT --to-port 3128 example rule to redirect udp 53 (It could be another similar):
Note: Squid "listen" high udp port. example: 36352, Command: netstat -tlunp | grep squid
reference: http://linuxplayer.org/2012/02/why-squid-listen-on-high-udp-port-number
iptables -t nat -A PREROUTING -s 192.168.0.0/24 -i eth1 -p udp --dport 53 -j REDIRECT --to-port 36352 PD: These are just examples of squid directives related to DNS. I am not claiming that they serve my purposes:
positive_dns_ttl negative_dns_ttl dns_nameservers 8.8.8.8 8.8.4.4 udp_incoming_address Important:
If someone says itthis can not be done, read this article first: http://linuxplayer.org/2012/02/why-squid-listen-on-high-udp-port-number
I accept alternatives