V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
ZGLHHH
V2EX  ›  分享创造

Bash 脚本——一键建立 DNS

  •  
  •   ZGLHHH · 2016-02-16 03:22:15 +08:00 · 3592 次点击
    这是一个创建于 3001 天前的主题,其中的信息可能已经有所发展或是发生改变。
    该脚本适用于 CentOS
    仅方便使用 https://github.com/zyqf/DNS 建立 DNS

    #!/bin/bash
    #by HuanMeng
    #Blog: https://ihuanmeng.com
    githuburl='https://github.com/zyqf/DNS.git'
    gitclonedir='/root/github/'
    yum install bind git -y;
    mkdir ${gitclonedir}
    cd ${gitclonedir}
    git clone ${githuburl}
    \cp DNS/named.conf /etc/named.conf -f
    \cp DNS/named.rfc1912.zones/named.rfc1912.zones /etc/named.rfc1912.zones -f
    \cp DNS/named/* /var/named/ -r -f
    #CentOS6
    service iptables stop
    chkconfig iptables off
    #CentOS7
    systemctl disable firewalld
    systemctl stop firewalld
    service named restart
    ifconfig
    14 条回复    2016-02-18 17:07:30 +08:00
    ryd994
        1
    ryd994  
       2016-02-16 06:12:27 +08:00 via Android
    不开防火墙,公网 DNS ,不限频率,你这是不要命了啊
    壮士,请受我一拜
    873681136
        2
    873681136  
       2016-02-16 09:03:01 +08:00 via iPhone
    我想知道楼主敢用在实际环境吗
    9hills
        3
    9hills  
       2016-02-16 09:07:57 +08:00 via iPhone
    壮士你好
    cielpy
        4
    cielpy  
       2016-02-16 09:15:53 +08:00
    开放 53 端口分分钟就被认证了。
    demo
        5
    demo  
       2016-02-16 09:49:27 +08:00
    禁用防火墙,真牛逼
    maskerTUI
        6
    maskerTUI  
       2016-02-16 10:13:40 +08:00 via Android
    service iptables stop
    chkconfig iptables off
    看到这两行代码我惊呆了(⊙o⊙)!
    evlos
        7
    evlos  
       2016-02-16 10:16:52 +08:00
    #CentOS6
    service iptables stop
    chkconfig iptables off
    #CentOS7
    systemctl disable firewalld
    systemctl stop firewalld

    666666
    7654
        8
    7654  
       2016-02-16 10:35:43 +08:00
    iptables -A INPUT -p udp --dport 53 -m recent --set --name dnslimit
    iptables -A INPUT -p udp --dport 53 -m recent --update --seconds 2 --hitcount 18 --name dnslimit -j DROP
    service iptables save
    为什么不按照 github 上的 DNS server security 操作呢,感觉恶意满满
    lgpqdwjh
        9
    lgpqdwjh  
       2016-02-16 11:48:04 +08:00
    这是要干啥啊 干啥啊
    AstroProfundis
        10
    AstroProfundis  
       2016-02-16 11:51:44 +08:00
    带宽跑满然后流量耗尽机器死掉
    如果在这之前还没被服务商禁用的话...
    iptux
        11
    iptux  
       2016-02-16 12:59:43 +08:00 via Android
    \cp 这么用是有什么讲究么?
    873681136
        12
    873681136  
       2016-02-16 14:25:42 +08:00 via iPhone
    用软链接的方法不是更好?还可以差量升级呢
    Delbert
        13
    Delbert  
       2016-02-16 20:10:03 +08:00 via iPad
    @iptux 使用没有被 alias 过的 cp 命令。
    strwei
        14
    strwei  
       2016-02-18 17:07:30 +08:00
    防火墙,呵呵哒
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   846 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:11 · PVG 03:11 · LAX 12:11 · JFK 15:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.