<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Linux Iptables block or open DNS / bind service port 53</title> <atom:link href="http://www.cyberciti.biz/tips/linux-iptables-12-how-to-block-or-open-dnsbind-service-port-53.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/linux-iptables-12-how-to-block-or-open-dnsbind-service-port-53.html</link> <description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description> <lastBuildDate>Fri, 10 Feb 2012 20:37:43 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Tricky</title><link>http://www.cyberciti.biz/tips/linux-iptables-12-how-to-block-or-open-dnsbind-service-port-53.html#comment-160681</link> <dc:creator>Tricky</dc:creator> <pubDate>Wed, 03 Nov 2010 06:37:49 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-12-how-to-block-or-open-dnsbind-service-port-53.html#comment-160681</guid> <description>For pure and simple DNS client (not hosting DNS server and so on), I scripted it as follows:
&lt;code&gt;for dnsserverip in `grep nameserver /etc/resolv.conf &#124; sed &#039;s/.* //&#039;` ; do
/usr/sbin/iptables -A INPUT -p udp --dport 53 -s $dnsserverip -m state --state NEW -j ACCEPT
/usr/sbin/iptables -A INPUT -p tcp --dport 53 -s $dnsserverip -m state --state NEW -j ACCEPT
done&lt;/code&gt;
I also have separate lines in my generic iptables script globally allowing &quot;ESTABLISHED,RELATED&quot;, negating the need for adding these parameters elsewhere.</description> <content:encoded><![CDATA[<p>For pure and simple DNS client (not hosting DNS server and so on), I scripted it as follows:<br
/> <code>for dnsserverip in `grep nameserver /etc/resolv.conf | sed 's/.* //'` ; do<br
/> /usr/sbin/iptables -A INPUT -p udp --dport 53 -s $dnsserverip -m state --state NEW -j ACCEPT<br
/> /usr/sbin/iptables -A INPUT -p tcp --dport 53 -s $dnsserverip -m state --state NEW -j ACCEPT<br
/> done</code></p><p>I also have separate lines in my generic iptables script globally allowing &#8220;ESTABLISHED,RELATED&#8221;, negating the need for adding these parameters elsewhere.</p> ]]></content:encoded> </item> <item><title>By: Crisu</title><link>http://www.cyberciti.biz/tips/linux-iptables-12-how-to-block-or-open-dnsbind-service-port-53.html#comment-153328</link> <dc:creator>Crisu</dc:creator> <pubDate>Thu, 04 Feb 2010 17:44:58 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-12-how-to-block-or-open-dnsbind-service-port-53.html#comment-153328</guid> <description>Hi guys, don&#039;t know it is right place to post it but i&#039;d like to ask does any of you know how to change that port 53 to port 25. Our profesors in scool gave us something like this to solve.</description> <content:encoded><![CDATA[<p>Hi guys, don&#8217;t know it is right place to post it but i&#8217;d like to ask does any of you know how to change that port 53 to port 25. Our profesors in scool gave us something like this to solve.</p> ]]></content:encoded> </item> <item><title>By: sims</title><link>http://www.cyberciti.biz/tips/linux-iptables-12-how-to-block-or-open-dnsbind-service-port-53.html#comment-147972</link> <dc:creator>sims</dc:creator> <pubDate>Fri, 03 Apr 2009 15:06:01 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-12-how-to-block-or-open-dnsbind-service-port-53.html#comment-147972</guid> <description>Also say your running a name server and you need to communicate with any name servers:
&lt;code&gt;
IPADDR=xxx.xxx.xxx.xxx
UNPRIVPORTS=&quot;1024:65535&quot;
iptables -A OUTPUT -p udp -s $IPADDR --sport $UNPRIVPORTS -d 0/0 --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp -s 0/0 --sport 53 -d $IPADDR --dport $UNPRIVPORTS -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s $IPADDR --sport $UNPRIVPORTS -d 0/0 --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -s 0/0 --sport 53 -d $IPADDR --dport $UNPRIVPORTS -m state --state ESTABLISHED -j ACCEPT
&lt;/code&gt;</description> <content:encoded><![CDATA[<p>Also say your running a name server and you need to communicate with any name servers:</p><p><code><br
/> IPADDR=xxx.xxx.xxx.xxx<br
/> UNPRIVPORTS="1024:65535"<br
/> iptables -A OUTPUT -p udp -s $IPADDR --sport $UNPRIVPORTS -d 0/0 --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT<br
/> iptables -A INPUT -p udp -s 0/0 --sport 53 -d $IPADDR --dport $UNPRIVPORTS -m state --state ESTABLISHED -j ACCEPT<br
/> iptables -A OUTPUT -p tcp -s $IPADDR --sport $UNPRIVPORTS -d 0/0 --dport 53 -m state --state NEW,ESTABLISHED -j ACCEPT<br
/> iptables -A INPUT -p tcp -s 0/0 --sport 53 -d $IPADDR --dport $UNPRIVPORTS -m state --state ESTABLISHED -j ACCEPT<br
/> </code></p> ]]></content:encoded> </item> <item><title>By: sims</title><link>http://www.cyberciti.biz/tips/linux-iptables-12-how-to-block-or-open-dnsbind-service-port-53.html#comment-147971</link> <dc:creator>sims</dc:creator> <pubDate>Fri, 03 Apr 2009 14:27:44 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/linux-iptables-12-how-to-block-or-open-dnsbind-service-port-53.html#comment-147971</guid> <description>Hey buddy,
check out this line in your how to:
&lt;code&gt;iptables -A OUTPUT-p&lt;/code&gt;
Poor copy and pasters</description> <content:encoded><![CDATA[<p>Hey buddy,</p><p>check out this line in your how to:</p><p><code>iptables -A OUTPUT-p</code></p><p>Poor copy and pasters</p> ]]></content:encoded> </item> </channel> </rss>
