Skip to content

Commit

Permalink
pref: 优化延迟测速,大幅提升性能;config: 增加更多DNS服务器,剔除解析结果较差的服务器
Browse files Browse the repository at this point in the history
  • Loading branch information
sinspired committed Dec 5, 2024
1 parent 4aff815 commit eb3af14
Show file tree
Hide file tree
Showing 7 changed files with 884 additions and 412 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python 3.11
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
pip install -U pyinstaller
- name: Build executables (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
for script in setDNS.py setHosts.py setHosts_Classic.py; do
pyinstaller --onefile "$script"
pyinstaller --clean --onefile "$script"
mv "dist/${script%.py}" "dist/${script%.py}-Linux-x64"
done
zip -j "cnNetTool-Linux-x64.zip" dist/*-Linux-x64
Expand All @@ -57,9 +57,9 @@ jobs:
$icoName = $script -replace '\.py$', '.ico'
if (Test-Path -Path $icoName) {
pyinstaller --onefile $script --uac-admin --icon $icoName
pyinstaller --clean --onefile $script --uac-admin --icon $icoName
} else {
pyinstaller --onefile $script --uac-admin
pyinstaller --clean --onefile $script --uac-admin
}
# pyinstaller --onefile $script --uac-admin
Expand All @@ -73,7 +73,7 @@ jobs:
if: matrix.os == 'macos-latest'
run: |
for script in setDNS.py setHosts.py setHosts_Classic.py; do
pyinstaller --onefile "$script"
pyinstaller --clean --onefile "$script"
mv "dist/${script%.py}" "dist/${script%.py}-macOS-x64"
done
zip -j "cnNetTool-macOS-x64.zip" dist/*-macOS-x64
Expand Down Expand Up @@ -144,4 +144,4 @@ jobs:
**/cnNetTool-Linux-x64.zip \
**/cnNetTool-Windows-x64.zip \
**/cnNetTool-macOS-x64.zip
shell: bash
shell: bash
4 changes: 3 additions & 1 deletion .github/workflows/update_hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- 'setHosts.py'
- 'setHosts_Classic.py'
- 'requirements.txt'
branches:
- 'main'
schedule:
- cron: '0 */4 * * *'
workflow_dispatch:
Expand Down Expand Up @@ -50,4 +52,4 @@ jobs:
add: |
hosts
README.md
push: "--force"
push: true
169 changes: 106 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,80 +30,123 @@

```bash

# cnNetTool Start in 2024-11-30 12:24:58 +08:00
# cnNetTool Start in 2024-12-05 11:37:05 +08:00
140.82.113.26 alive.github.com
140.82.112.5 api.github.com
140.82.112.21 central.github.com
140.82.113.9 codeload.github.com
140.82.114.22 collector.github.com
140.82.113.4 gist.github.com
140.82.114.3 github.com
140.82.114.18 github.community
146.75.29.194 github.global.ssl.fastly.net
16.182.38.33 github-com.s3.amazonaws.com
16.15.185.16 github-production-release-asset-2e65be.s3.amazonaws.com
140.82.114.26 live.github.com
20.205.243.168 api.github.com
140.82.113.22 central.github.com
20.205.243.165 codeload.github.com
140.82.113.22 collector.github.com
140.82.112.3 gist.github.com
20.205.243.166 github.com
140.82.113.18 github.community
151.101.129.194 github.global.ssl.fastly.net
2a03:2880:f131:83:face:b00c:0:25de github.global.ssl.fastly.net
16.182.37.73 github-com.s3.amazonaws.com
3.5.21.112 github-production-release-asset-2e65be.s3.amazonaws.com
140.82.112.25 live.github.com
13.107.42.16 pipelines.actions.githubusercontent.com
185.199.110.154 github.githubassets.com
185.199.108.153 github.io
185.199.108.154 github.githubassets.com
185.199.108.153 githubstatus.com
2606:50c0:8001::153 githubstatus.com
185.199.108.153 assets-cdn.github.com
185.199.109.133 avatars.githubusercontent.com
185.199.109.133 avatars0.githubusercontent.com
185.199.109.133 avatars1.githubusercontent.com
185.199.109.133 avatars2.githubusercontent.com
185.199.109.133 avatars3.githubusercontent.com
185.199.109.133 avatars4.githubusercontent.com
185.199.109.133 avatars5.githubusercontent.com
185.199.109.133 camo.githubusercontent.com
185.199.109.133 cloud.githubusercontent.com
185.199.109.133 desktop.githubusercontent.com
185.199.109.133 favicons.githubusercontent.com
185.199.109.133 github.map.fastly.net
185.199.109.133 media.githubusercontent.com
185.199.109.133 objects.githubusercontent.com
185.199.109.133 private-user-images.githubusercontent.com
185.199.109.133 raw.githubusercontent.com
185.199.109.133 user-images.githubusercontent.com
18.160.200.13 tmdb.org
18.160.200.13 api.tmdb.org
18.160.200.13 files.tmdb.org
52.85.247.30 themoviedb.org
52.85.247.30 api.themoviedb.org
52.85.247.30 www.themoviedb.org
52.85.247.30 auth.themoviedb.org
185.93.1.244 image.tmdb.org
185.93.1.244 images.tmdb.org
52.94.225.248 imdb.com
3.168.35.144 www.imdb.com
2606:50c0:8001::153 assets-cdn.github.com
185.199.108.153 github.io
2606:50c0:8001::153 github.io
185.199.108.133 avatars.githubusercontent.com
2606:50c0:8002::154 avatars.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
2606:50c0:8002::154 avatars0.githubusercontent.com
185.199.108.133 avatars1.githubusercontent.com
2606:50c0:8002::154 avatars1.githubusercontent.com
185.199.108.133 avatars2.githubusercontent.com
2606:50c0:8002::154 avatars2.githubusercontent.com
185.199.108.133 avatars3.githubusercontent.com
2606:50c0:8002::154 avatars3.githubusercontent.com
185.199.108.133 avatars4.githubusercontent.com
2606:50c0:8002::154 avatars4.githubusercontent.com
185.199.108.133 avatars5.githubusercontent.com
2606:50c0:8002::154 avatars5.githubusercontent.com
185.199.108.133 camo.githubusercontent.com
2606:50c0:8002::154 camo.githubusercontent.com
185.199.108.133 cloud.githubusercontent.com
2606:50c0:8002::154 cloud.githubusercontent.com
185.199.108.133 desktop.githubusercontent.com
2606:50c0:8002::154 desktop.githubusercontent.com
185.199.108.133 favicons.githubusercontent.com
2606:50c0:8002::154 favicons.githubusercontent.com
185.199.108.133 github.map.fastly.net
2606:50c0:8002::154 github.map.fastly.net
185.199.108.133 media.githubusercontent.com
2606:50c0:8002::154 media.githubusercontent.com
185.199.108.133 objects.githubusercontent.com
2606:50c0:8002::154 objects.githubusercontent.com
185.199.108.133 private-user-images.githubusercontent.com
2606:50c0:8002::154 private-user-images.githubusercontent.com
185.199.108.133 raw.githubusercontent.com
2606:50c0:8002::154 raw.githubusercontent.com
185.199.108.133 user-images.githubusercontent.com
2606:50c0:8002::154 user-images.githubusercontent.com
54.230.71.49 tmdb.org
2600:9000:2014:8a00:5:da10:7440:93a1 tmdb.org
54.230.71.49 api.tmdb.org
2600:9000:2014:8a00:5:da10:7440:93a1 api.tmdb.org
54.230.71.49 files.tmdb.org
2600:9000:2014:8a00:5:da10:7440:93a1 files.tmdb.org
13.226.61.96 themoviedb.org
2600:9000:2816:5000:e:5373:440:93a1 themoviedb.org
13.226.61.96 api.themoviedb.org
2600:9000:2816:5000:e:5373:440:93a1 api.themoviedb.org
13.226.61.96 www.themoviedb.org
2600:9000:2816:5000:e:5373:440:93a1 www.themoviedb.org
13.226.61.96 auth.themoviedb.org
2600:9000:2816:5000:e:5373:440:93a1 auth.themoviedb.org
109.61.83.98 image.tmdb.org
2400:52e0:1500::1092:1 image.tmdb.org
109.61.83.98 images.tmdb.org
2400:52e0:1500::1092:1 images.tmdb.org
52.94.228.167 imdb.com
13.35.217.192 www.imdb.com
52.94.237.74 secure.imdb.com
3.168.35.144 s.media-imdb.com
52.94.237.74 us.dd.imdb.com
3.168.35.144 www.imdb.to
52.94.225.248 imdb-webservice.amazon.com
18.172.46.173 s.media-imdb.com
52.94.225.248 us.dd.imdb.com
13.35.217.192 www.imdb.to
52.94.228.167 imdb-webservice.amazon.com
44.215.137.99 origin-www.imdb.com
146.75.29.16 m.media-amazon.com
146.75.29.16 Images-na.ssl-images-amazon.com
104.123.159.75 images-fe.ssl-images-amazon.com
3.167.162.195 images-eu.ssl-images-amazon.com
146.75.29.16 ia.media-imdb.com
146.75.29.16 f.media-amazon.com
52.84.18.90 imdb-video.media-imdb.com
3.167.180.205 dqpnq362acqdi.cloudfront.net
142.250.190.74 translate.google.com
142.250.190.74 translate.googleapis.com
142.250.190.74 translate-pa.googleapis.com
3.167.138.84 plugins.jetbrains.com
3.167.138.84 download.jetbrains.com
3.167.138.84 cache-redirector.jetbrains.com

# Update time: 2024-11-30 12:24:58 +08:00
23.49.104.166 m.media-amazon.com
2600:9000:2078:f800:1d:d7f6:39d4:e6e1 m.media-amazon.com
151.101.65.16 Images-na.ssl-images-amazon.com
2600:1417:4400:12::1721:b8e7 Images-na.ssl-images-amazon.com
23.49.104.166 images-fe.ssl-images-amazon.com
2600:9000:2079:fa00:1d:d7f6:39d4:e6e1 images-fe.ssl-images-amazon.com
151.101.129.16 images-eu.ssl-images-amazon.com
2600:9000:2751:1a00:1d:d7f6:39d4:e6e1 images-eu.ssl-images-amazon.com
23.49.104.166 ia.media-imdb.com
2600:1417:4400:12::1721:b8e7 ia.media-imdb.com
151.101.129.16 f.media-amazon.com
2a04:4e42:48::272 f.media-amazon.com
13.35.186.103 imdb-video.media-imdb.com
13.32.32.190 dqpnq362acqdi.cloudfront.net
2600:9000:27af:7600:5:ce70:a180:21 dqpnq362acqdi.cloudfront.net
34.105.140.105 translate.google.com
2404:6800:4005:823::200a translate.google.com
34.105.140.105 translate.googleapis.com
2404:6800:4005:823::200a translate.googleapis.com
34.105.140.105 translate-pa.googleapis.com
2404:6800:4005:823::200a translate-pa.googleapis.com
13.33.183.20 plugins.jetbrains.com
2600:9000:2014:f600:12:7c44:15c0:93a1 plugins.jetbrains.com
13.33.183.20 download.jetbrains.com
2600:9000:2014:f600:12:7c44:15c0:93a1 download.jetbrains.com
13.33.183.20 cache-redirector.jetbrains.com
2600:9000:2014:f600:12:7c44:15c0:93a1 cache-redirector.jetbrains.com

# Update time: 2024-12-05 11:37:05 +08:00
# GitHub仓库: https://github.com/sinspired/cnNetTool
# cnNetTool End

```

以上内容会自动定时更新, 数据更新时间:2024-11-30 12:24:58 +08:00
以上内容会自动定时更新, 数据更新时间:2024-12-05 11:37:05 +08:00

#### 1.2.2 修改 hosts 文件

Expand Down
7 changes: 4 additions & 3 deletions README_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ pip install -r requirements.txt
### DNS 服务器工具 `SetDNS.py`

* --debug 启用调试日志
* --show-availbale-list, --list 显示可用dns列表,通过 --num 控制显示数量
* --best-dns-num BEST_DNS_NUM, --num 显示最佳DNS服务器的数量
* --show-availbale-list, --list, -l 显示可用dns列表,通过 --num 控制显示数量
* --best-dns-num BEST_DNS_NUM, --num, -n 显示最佳DNS服务器的数量
* --algorithm --mode {region,overall} 默认 `region` 平衡IPv4和ipv6 DNS,选择 `overall` 则会在所有IP中选择最快IP
* --show-resolutions, --show 显示域名解析结果
* --show-resolutions, --resolutions, -r 显示域名解析结果
* --only-global, --global 仅使用国际DNS服务器

### Hosts文件工具 `SetHosts.py`

Expand Down
Loading

0 comments on commit eb3af14

Please sign in to comment.