Bash 脚本——一键建立 DNS

2016-02-16 03:22:15 +08:00
 ZGLHHH
该脚本适用于 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
3623 次点击
所在节点    分享创造
14 条回复
ryd994
2016-02-16 06:12:27 +08:00
不开防火墙,公网 DNS ,不限频率,你这是不要命了啊
壮士,请受我一拜
873681136
2016-02-16 09:03:01 +08:00
我想知道楼主敢用在实际环境吗
9hills
2016-02-16 09:07:57 +08:00
壮士你好
cielpy
2016-02-16 09:15:53 +08:00
开放 53 端口分分钟就被认证了。
demo
2016-02-16 09:49:27 +08:00
禁用防火墙,真牛逼
maskerTUI
2016-02-16 10:13:40 +08:00
service iptables stop
chkconfig iptables off
看到这两行代码我惊呆了(⊙o⊙)!
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
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
2016-02-16 11:48:04 +08:00
这是要干啥啊 干啥啊
AstroProfundis
2016-02-16 11:51:44 +08:00
带宽跑满然后流量耗尽机器死掉
如果在这之前还没被服务商禁用的话...
iptux
2016-02-16 12:59:43 +08:00
\cp 这么用是有什么讲究么?
873681136
2016-02-16 14:25:42 +08:00
用软链接的方法不是更好?还可以差量升级呢
Delbert
2016-02-16 20:10:03 +08:00
@iptux 使用没有被 alias 过的 cp 命令。
strwei
2016-02-18 17:07:30 +08:00
防火墙,呵呵哒

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/256742

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX