加载中
加载中
表情图片
评为精选
鼓励
加载中...
分享
加载中...
文件下载
加载中...
修改排序
加载中...
与诸位爱墙人士分享一个关于DNS的小脚本
我说要有光2016/04/15软件综合 IP:河北
科学上网要求使用未被污染的 DNS ,但使用 ISP 提供之外的 DNS 通常会导致使用者无法享受各种 CDN 带来的加速福利。

为此,小光编写了一个方便实用的小脚本供大家参考,使用此脚本时请配合 iptables 中的 geoip 模块共同使用,将目标为墙内的 IP 分离出来进行直接连接,以便使其真正发挥效果。

在例子 "|08|bilibili|03|com" 中,第一个08是指 “bilibili” 这一域名包含8个字节,03则指“com”包含3个字节,您可以依此规则根据自己的需要增加修改这个列表。

Other
# Create new chain iptables -t nat -N DNSCRYPTPROXY    # MiniLight's whitelist iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|05|baidu|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|06|taobao|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|08|bilibili|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|05|hdslb|03|net" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|05|hdslb|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|05|iqiyi|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|02|qq|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|04|sina|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|06|wechat|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|05|weibo|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|03|163|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|07|tencent|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|06|alipay|03|com" --algo bm -j RETURN iptables -t nat -A DNSCRYPTPROXY -m string --hex-string "|06|alicdn|03|com" --algo bm -j RETURN    # redirected DNS packet to dnscrypt-proxy iptables -t nat -A DNSCRYPTPROXY -p tcp --dport 53 -j DNAT --to-destination 127.0.0.1:5353 iptables -t nat -A DNSCRYPTPROXY -p udp --dport 53 -j DNAT --to-destination 127.0.0.1:5353    # redirected DNS packet to DNSCRYPTPROXY chain iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNSCRYPTPROXY iptables -t nat -A OUTPUT -p udp --dport 53 -j DNSCRYPTPROXY
来自:计算机科学 / 软件综合
1
新版本公告
~~空空如也

想参与大家的讨论?现在就 登录 或者 注册

所属专业
所属分类
上级专业
同级专业
我说要有光
进士 学者 机友 笔友
文章
317
回复
5542
学术分
15
2008/03/06注册,3天2时前活动

Inspiration, Innovation, Discovery

主体类型:个人
所属领域:无
认证方式:手机号
IP归属地:未同步
插入公式
评论控制
加载中...
文号:{{pid}}
投诉或举报
加载中...
{{tip}}
请选择违规类型:
{{reason.type}}

空空如也

笔记
{{note.content}}
{{n.user.username}}
{{fromNow(n.toc)}} {{n.status === noteStatus.disabled ? "已屏蔽" : ""}} {{n.status === noteStatus.unknown ? "正在审核" : ""}} {{n.status === noteStatus.deleted ? '已删除' : ''}}
  • 编辑
  • 删除
  • {{n.status === 'disabled' ? "解除屏蔽" : "屏蔽" }}
我也是有底线的