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: 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: 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)
    • Re: rsh and firewalls
      ... the client. ... The firewall guy says it is using tcp with the -a flag but udp without ... > sounds like maybe there is no reverse dns lookup behind the firewall ...
      (comp.unix.aix)
    • Re: Testing F5 3DNS
      ... simply be horrible at DNS with respect to DNS. ... Connection Firewall, for instance, will open its resolver's port to all ... It can be seen that when the Windows XP computer sent a UDP packet from ...
      (Pen-Test)

    Loading