loading ...
评论列表 日志列表 访客列表 留言列表
loading...

2007-12-12 | linux下的DNS转发     朗读全文

好久没配过DNS了,今天又费了点劲搞定了,记下来。
 
1.在/etc/named.conf 的options字段增加
   options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
         // query-source address * port 53;
        forwarders {192.168.0.1;192.168.1.22;};
};
 
2.写配置脚本
  #!/bin/bash
  #打开转发
  echo 1 > /proc/sys/net/ipv4/ip_forward
  #加载模块
  /sbin/modprobe iptable_filter
  /sbin/modprobe ip_tables
  #/sbin/modprobe iptables_nat
  #刷新规则
  /sbin/iptables -t nat -F
  #新规则
  /sbin/iptables -t nat -A POSTROUTING -s 192.168.29.0/255.255.255.0 -j MASQUERADE
评论 (0) |  阅读 (?)  |  固定链接 |  发表于 17:22  | 最后修改于 2007-12-12 17:22

评论

正在读取评论信息...
您还未登录,只能匿名发表评论。或者您可以 登录 后发表。
*