Re: Definitive iptables configuration for DNS cache?

From: Glen Cook (some@guy.com)
Date: 01/30/03

  • Next message: al: "Re: vsftp"
    From: "Glen Cook" <some@guy.com>
    Date: Thu, 30 Jan 2003 05:18:09 GMT
    
    

    "sPh" <sphealey@worldnet.att.net> wrote in message
    news:a1e85ad4.0301281759.2b5cfdeb@posting.google.com...
    > I have dnscache working fine on the host running the cache, but I
    > cannot get any other hosts to connect when the firewall is running.
    > If I disable the firewall then they can connect.
    >

    If I had to guess, I'd probably say you probably just need a better
    understanding of how DNS works. DNS is a little different than other
    protocols, like HTTP. Specifically, the fact that DNS normally tries to use
    UDP for queries, not TCP. As such, when you receive the answer, it is in a
    UDP packet as well. Therefore opening your firewall to TCP port 53 and using
    established, related rules will not work. The notion of established, related
    connections doesn't apply to UDP packets. You'll need an explicit rule for
    the DNS packets going in both directions (particularily the responses).
    Something like:

    /sbin/iptables -A OUPUT -i eth0 -p udp -s 0/0 -d 0/0 --destination-port
    53 -j ACCEPT
    /sbin/iptables -A INPUT -i eth0 -p udp -s 0/0 --source-port 53 -d 0/0 -j
    ACCEPT

    depending on exactly how you're filtering things.

    You may also want to include TCP rules as well, as DNS may use TCP sessions
    if the reply to the query is too large for a single UDP packet.

    Don't know if this is your particular problem, but I've seen this be the
    case before.]

    Glen



    Relevant Pages

    • RE: Preparing for upcoming DNSSEC changes on 5/5
      ... We already allow for udp 512 and tcp for DNS. ... the same network, behind the same firewall & router. ... consider the fact that a low UDP response will result in a TCP ...
      (comp.protocols.dns.bind)
    • Re: Windows 2003 Help
      ... Reconfigure the DC's as also posted in DNS NG: ... In the private ip range i would not enable the firewall between the DC's. ... 53211 TCP ... 53 TCP and UDP ...
      (microsoft.public.windows.server.general)
    • Re: Preparing for upcoming DNSSEC changes on 5/5
      ... behind the same firewall & router. ... Both came back and reported "DNS reply size limit is at least 3843" ... consider the fact that a low UDP response will result in a TCP ...
      (comp.protocols.dns.bind)
    • Re: about port 6667
      ... Ethereal and/or WinDump should be able to look for DNS header information: ... Is there any chance you or your firewall has a rule that blocks all traffic ... involving port TCP 6667 or TCP 53 regardless of whether it is part of what ... common port used by IRC chat and IRC remote control worms [and other ...
      (microsoft.public.win2000.security)
    • Re: NSLOOKUP question
      ... All the servers point to each other in DNS - but the 2 that can't resolve ... an NSLOOKUP query are behind a different make of firewall ... Why would a firewall interfere with NSLookup? ... size of a UDP packet and cause problems for ...
      (microsoft.public.windows.server.dns)