# -*-sh-*-
#
# IN_DNS chain for scipfire
#
# $Id: IN_DNS,v 1.2 2001/07/29 21:23:35 scip Exp $



#
# The name of this chain
CHAIN=IN_DNS


#
# get the type of mode we are running under
# will be one of: start | startlog | print | stop
MODE=$1


#
# get the base path
PREFIX=$2


#
# source the config
. $PREFIX/conf/scipfire.cfg



#
# get a list of dns servers, which we use
DNS=$(grep '^nameserver' /etc/resolv.conf | awk '{print $2}')


#
# now $MODE is only start or stop!
case $MODE in
  "start")
    echo "  Initialize $CHAIN"
    #
    # initialize this chain
    $echo $iptables -N $CHAIN                # create the new chain
    $echo $iptables -F $CHAIN                # flush possibly existing rules(for restart|reload!)

    #
    # query replys to me
    #for server in $DNS; do
    $fw -p udp --sport 53 -s 0/0 -d $EX_ME -j ACCEPT
    #done
    
    ;;
  "stop")
    echo "  Deleting $CHAIN"
    #
    # zero and delete this chain
    $iptables -F $CHAIN
    $iptables -X $CHAIN
    ;;
esac
