之前说了routeros自动下载规则,进行ip分流以及ip屏蔽。
但是如果dns被泥水了怎么办。除了dnsmap什么的其他的办法,这里来说下自己 通过爬文的出来的通过ros自己来进行dns分流的办法。
##注意
- 分流只是解决了分流问题,分流后怎么粗去还是要大家显神通啊。
- "1024\\.com|chh\\.com" 这个需要大家自己把需要的域名替换即可
- 为什么要有两个,是因为我这边域名太多,一条会提示规则太长
- 我是通过winbox设置的,下面代码是自己手敲的,如有误,请帮忙指正。谢谢大佬~
-----------------------------------------------------------------------------------------------------------------------------
/ip firewall layer7-protocol
add name=1111dns regexp="1024\\.com|chh\\.com"
add name=1111dns01 regexp="2048\\.com|tang\\.com"
/
/ip firewall mangle
add chain=prerouting action=mark-routing new-routing-mark=to1111dns passthrough=no layer7-protocol=1111dns protocol=udp in-interface=LAN dst-port=53 comment="rerouting to prerouting"
add chain=prerouting action=mark-routing new-routing-mark=to1111dns01 passthrough=no layer7-protocol=1111dns01 protocol=udp in-interface=LAN dst-port=53 comment="rerouting to prerouting01"
/
/ip firewall nat
add chain=dstnat protocol=udp routing-mark=to1111dns action=dst-nat to-addresses=1.1.1.1 to-ports=53
add chain=dstnat protocol=udp routing-mark=to1111dns01 action=dst-nat to-addresses=1.1.1.1 to-ports=53
/
----------------------------------------------------------------------------------------------------------------------