全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
楼主: kelvin225

[Windows VPS] $$r怎么在服务端禁掉网址

[复制链接]
 楼主| 发表于 2017-11-26 21:55:28 | 显示全部楼层
teddysun 发表于 2017-11-26 21:50
iptables -t raw -A OUTPUT -m string --algo bm --string "360.cn" -j DROP
iptables -t raw -A PREROUTIN ...

感谢大佬 不过运行第一条卡住了
发表于 2017-11-26 21:57:38 | 显示全部楼层
kelvin225 发表于 2017-11-26 21:55
感谢大佬 不过运行第一条卡住了
  1. iptables -A OUTPUT -m string --algo bm --string "360.cn" -j DROP
  2. iptables -A PREROUTING -m string --algo bm --string "360.cn" -j DROP
  3. iptables -A OUTPUT -m string --algo bm --string "360.com" -j DROP
  4. iptables -A PREROUTING -m string --algo bm --string "360.com" -j DROP
复制代码
发表于 2017-11-26 21:59:32 | 显示全部楼层
最后别忘了保存 iptables 规则
iptables-save  (CentOS 7)

/etc/init.d/iptables save (CentOS 6)

然后再 restart 一下 iptables
发表于 2017-11-26 22:24:12 | 显示全部楼层
本帖最后由 604542720 于 2017-11-26 22:26 编辑
teddysun 发表于 2017-11-26 21:59
最后别忘了保存 iptables 规则
iptables-save  (CentOS 7)


大佬,好像不用restart吧,我试过直接就能生效
iptables -A OUTPUT -m string --string "360.cn" --algo bm --to 65535 -j DROP

不过重启后就没了,要 save
发表于 2017-11-26 22:26:32 | 显示全部楼层
dnsmasq 正解,

用 dnsmasq 匹配泛域名解析为 127.0.0.1
老司机 该用户已被删除
发表于 2017-11-26 22:43:29 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| 发表于 2017-11-26 22:47:12 | 显示全部楼层
老司机 发表于 2017-11-26 22:43
上面那个不对,应该禁止进入到VPS才行。

大佬这是完全版吗?
发表于 2017-11-27 00:09:05 | 显示全部楼层
teddysun 发表于 2017-11-26 21:50
iptables -t raw -A OUTPUT -m string --algo bm --string "360.cn" -j DROP
iptables -t raw -A PREROUTIN ...

这么搞岂不是在loc都发不出这样的关键词了
发表于 2017-11-27 00:27:51 | 显示全部楼层
这样没用吧。ss客户端并不会默认把dns解析放到服务器上操作,也就是说客户在自己的电脑上就已经完成了域名的解析了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-10-6 08:27 , Processed in 0.064070 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表