Skip to main content
deleted 36 characters in body
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40

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

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

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 it can not be done, read this article first: http://linuxplayer.org/2012/02/why-squid-listen-on-high-udp-port-number

I accept alternatives

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 

If this can not be done, I accept alternatives

edited title
Link
acgbox
  • 1k
  • 5
  • 15
  • 40

iptables redirect dns to proxy port

deleted 13 characters in body
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40

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 (because squidIt could be another similar):

Note: Squid "listen" high udp port. example: 36352, Command: netstat netstat -tlunp | grep squid)-tlunp | grep squid

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 it can not be done, read this article first: http://linuxplayer.org/2012/02/why-squid-listen-on-high-udp-port-number

I accept alternatives

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?)

rule to redirect tcp 53:

iptables -t nat -A PREROUTING -s 192.168.0.0/24 -i eth1 -p tcp --dport 53 -j REDIRECT --to-port 3128 

rule to redirect udp 53 (because squid "listen" high udp port. example: 36352, Command: netstat -tlunp | grep squid)

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 it can not be done, read this article first: http://linuxplayer.org/2012/02/why-squid-listen-on-high-udp-port-number

I accept alternatives

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

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 it can not be done, read this article first: http://linuxplayer.org/2012/02/why-squid-listen-on-high-udp-port-number

I accept alternatives

added 68 characters in body
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40
Loading
added 68 characters in body
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40
Loading
added 113 characters in body
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40
Loading
added 8 characters in body; edited title
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40
Loading
deleted 174 characters in body
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40
Loading
deleted 174 characters in body
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40
Loading
deleted 17 characters in body
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40
Loading
Post Undeleted by acgbox
Post Deleted by acgbox
added 334 characters in body
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40
Loading
deleted 11 characters in body
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40
Loading
Source Link
acgbox
  • 1k
  • 5
  • 15
  • 40
Loading