Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

排除解析为中国IP的网站 #3

Closed
miaomiaosoft opened this issue Nov 13, 2019 · 16 comments
Closed

排除解析为中国IP的网站 #3

miaomiaosoft opened this issue Nov 13, 2019 · 16 comments

Comments

@miaomiaosoft
Copy link

因懒于频繁添加被和谐网站,所以使用匹配所有主流后缀的方式强行全局:
#LEVEL3
ttl=12
md5=true
mss=0
.com
.org
.net

然后使用发现大多数网站全局下都没问题,但小部分国内网站会400或被重置之类访问失败,经测试将这类网站添加到此配置项后可以正常访问(我就当白名单用了),例如:
#LEVEL1
ttl=0
mss=0
md5=false
.cn
youdao.com
.youdao.com

然而国内网站的域名列表也是巨大无比,所以就想能否增加一项配置功能,忽略解析IP为中国的网站,这可能还需要调用一个外置的国内IP数据库

顺便说下一些台湾网站适合这个配置:
#LEVEL2
ttl=6
md5=true
mss=0
metroradio.com.hk
.metroradio.com.hk
cdns.com.tw
.cdns.com.tw
ltn.com.tw
.ltn.com.tw
gvm.com.tw
.gvm.com.tw
nextmag.com.tw
.nextmag.com.tw
cts.com.tw
.cts.com.tw
gamebase.com.tw
.gamebase.com.tw

@macronut
Copy link
Owner

macronut commented Nov 14, 2019

Get the latest release and edit config, for example:

ttl=12
md5=true
server=8.8.8.8:53
log=2

subdomain=6
.com
.net
.org
#Other Domain

#Whitelist
ttl=0
md5=0
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
100.64.0.0/10
#Othe IP of "LAN"

OR(Not recommended)

ttl=12
md5=true
server=8.8.8.8:53
log=2

subdomain=0

#Protectlist
0.0.0.0/0

#Whitelist
ttl=0
md5=0
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
100.64.0.0/10
Othe IP of "LAN"

In your case, you can set the TTL beforce domain or IP of taiwan, for example

ttl=6
.tw

or

ttl=6
1.34.0.0/15
1.160.0.0/12
1.200.0.0/16
27.0.152.0/22
27.51.0.0/16
27.52.0.0/15
27.96.224.0/19
...

@SeaHOH
Copy link

SeaHOH commented Nov 14, 2019

精确度高的列表会比较大,能不能做成支持外联以方便单独维护列表?

@SeaHOH
Copy link

SeaHOH commented Nov 14, 2019

外联到单独的文件主要是方便维护,主配置搞得太大使用上有所不便。

@SeaHOH
Copy link

SeaHOH commented Nov 14, 2019

比如这样

# config
ttl=0
md5=0
conf=cn_ip
# cn_ip
1.0.1.0/24
1.0.2.0/23
1.0.8.0/21
1.0.32.0/19
1.1.0.0/24
1.1.2.0/23
1.1.4.0/22
1.1.8.0/21
1.1.16.0/20
...

@miaomiaosoft
Copy link
Author

miaomiaosoft commented Nov 14, 2019

试了下,似乎不可用

ttl=12
md5=true
#server=8.8.8.8:53
log=2

subdomain=6
.com
.net
.org
#Other Domain

#Whitelist
ttl=0
md5=0
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
100.64.0.0/10
#Othe IP of "LAN"
#www.wdku.net=119.147.136.190
119.147.136.0/24

打开www.wdku.net会被ERR_CONNECTION_CLOSED,或者我配置改的有问题?

@miaomiaosoft
Copy link
Author

注释DNS不是因为只有注释了才能使用系统DNS么
看的我有点乱,有点不能理解,能否麻烦帖上一份较完整配置,可以先不管tw后缀

使用系统DNS
处理常见后缀 .com .net .org
不处理中国IP的网站

@miaomiaosoft
Copy link
Author

miaomiaosoft commented Nov 15, 2019

系统DNS肯定是纯净的,否则用这个就没意义
其实原本就是用的完整的国内IP段,只不过帖上来会太长所以只取了其中一个网站,我以为你能GET到这个用意

IP段用的这个 https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt

@miaomiaosoft
Copy link
Author

是下的0.2.2
重新下载覆盖也是同样的日期,应该没错

@miaomiaosoft
Copy link
Author

你那测试正常会不会与网络环境有关,我是联通
应该要看Log之类才知道会不会被处理

@miaomiaosoft
Copy link
Author

miaomiaosoft commented Nov 15, 2019

0.2.3
配置如上后面附加全部国内IP段
log=3
浏览器测试时频繁重启,应该可以排除缓存干扰结果

这个网站 https://www.wdku.net/ 有时能打开
当能打开时 点击里面的链接跳转到二级域名页面又会打不开
然后再返回到 https://www.wdku.net/ 也打不开了
维基百科基本上一直都能打开

打不开时日志是这样 [IP 5]

@miaomiaosoft
Copy link
Author

重启浏览器,程序的配置没变重启程序应该效果也不会变
没遇到什么崩溃
前面的IP就是 https://www.wdku.net/ 的IP

@miaomiaosoft
Copy link
Author

已更新测试
问题解决
谢谢!

@miaomiaosoft
Copy link
Author

miaomiaosoft commented Nov 18, 2019

025试了,IP段不生效了,CPU占用似乎也略有增加

@miaomiaosoft
Copy link
Author

只发现IP段不生效,功能没问题,CPU占用我印象之前一直是0,现在偶尔看到有1%-2%,不过这点占用可以忽略

@miaomiaosoft
Copy link
Author

对,国内IP排除失效

@miaomiaosoft
Copy link
Author

已更新测试,问题解决

cjh0613 referenced this issue in cjh0613/TCPioneer Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants