Answer the question
In order to leave comments, you need to log in
Allow dns queries in iptables
There are two following lines
iptables -A INPUT -p udp --dport 53 -j ACCEPT
iptables -A OUTPUT -p udp --sport 53 -j ACCEPT
[email protected]:/home/testr# iptables -nL
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- 192.168.1.60 0.0.0.0/0 tcp dpt:22
ACCEPT tcp -- 192.168.1.67 0.0.0.0/0 tcp dpt:22
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmptype 8
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53
ACCEPT tcp -- 192.168.1.11 0.0.0.0/0 tcp dpt:443
DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 192.168.1.60 tcp dpt:22
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp spt:22
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmptype 8
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp spt:53
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
[email protected]:/etc/network/if-up.d# ping ya.ru
ping: unknown host ya.ru
Answer the question
In order to leave comments, you need to log in
Sorry, I didn't understand right away.
I will leave here the solution and explanation, if for someone it is also not obvious.
It will be correct like this:
iptables -A INPUT -p udp --dport 53 -j ACCEPT
iptables -A OUTPUT -p udp --sport 53 --dport 1024:65535 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 53 -j ACCEPT
iptables -A INPUT -p udp -m udp --sport 53 --dport 1024:65535 -j ACCEPT
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question