网络下载加速,这里使用修改 hosts 文件 ,地址映射 方法,所有网址适用,这里以 WSL 下载服务器
为例子
命令 wsl -l -o
访问的地址:
https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json
加速访问
修改系统 hosts 文件
C:\Windows\System32\drivers\etc\hosts
比如 raw.staticdn.net
站长工具:查询dns: https://tool.chinaz.com/dns
找 TTL 最小的地址
然后 hosts文件里面 末尾 添加
## ip 网址 ,ip 是 TTL 值最小的那个
172.67.180.189 raw.staticdn.net
172.67.180.189 raw.githubusercontent.com
改完之后保存
管理员权限运行cmd,执行以下命令,刷新dns:
ipconfig /flushdns
然后验证访问
https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json
{
"Distributions": [
{
"Name": "Ubuntu",
"FriendlyName": "Ubuntu",
"StoreAppId": "9PDXGNCFSCZV",
"Amd64": true,
"Arm64": true,
"Amd64PackageUrl": "https://wslstorestorage.blob.core.windows.net/wslblob/Ubuntu_2204-221101_x64.appx",
"Arm64PackageUrl": "https://wslstorestorage.blob.core.windows.net/wslblob/Ubuntu_2204-221101_ARM64.appx",
"PackageFamilyName": "CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc"
},
{
"Name": "Debian",
"FriendlyName": "Debian GNU/Linux",
"StoreAppId": "9MSVKQC78PK6",
"Amd64": true,
"Arm64": true,
"Amd64PackageUrl": "https://wsldownload.azureedge.net/TheDebianProject.DebianGNULinux_1.12.2.0_neutral___76v4gfsz19hv4.AppxBundle",
"Arm64PackageUrl": "https://wsldownload.azureedge.net/TheDebianProject.DebianGNULinux_1.12.2.0_neutral___76v4gfsz19hv4.AppxBundle",
"PackageFamilyName": "TheDebianProject.DebianGNULinux_76v4gfsz19hv4"
},
{
"Name": "kali-linux",
"FriendlyName": "Kali Linux Rolling",
"StoreAppId": "9PKR34TNCV07",
"Amd64": true,
"Arm64": false,
"Amd64PackageUrl": "https://wsldownload.azureedge.net/KaliLinux_1.13.1.0.AppxBundle",
"Arm64PackageUrl": null,
"PackageFamilyName": "KaliLinux.54290C8133FEE_ey8k8hqnwqnmg"
},
{
"Name": "SLES-12",
"FriendlyName": "SUSE Linux Enterprise Server v12",
"StoreAppId": "9MZ3D1TRP8T1",
"Amd64": true,
"Arm64": false,
"Amd64PackageUrl": "https://wsldownload.azureedge.net/SLES-12_v1.appx",
"Arm64PackageUrl": null,
"PackageFamilyName": "46932SUSE.SUSELinuxEnterpriseServer12SP2_022rs5jcyhyac"
},
{
"Name": "SLES-15",
"FriendlyName": "SUSE Linux Enterprise Server v15",
"StoreAppId": "9NJFZK00FGKV",
"Amd64": true,
"Arm64": false,
"Amd64PackageUrl": null,
"Arm64PackageUrl": null,
"PackageFamilyName": null
},
{
"Name": "Ubuntu-18.04",
"FriendlyName": "Ubuntu 18.04 LTS",
"StoreAppId": "9N9TNGVNDL3Q",
"Amd64": true,
"Arm64": true,
"Amd64PackageUrl": "https://wsldownload.azureedge.net/Ubuntu_1804.2019.522.0_x64.appx",
"Arm64PackageUrl": "https://wsldownload.azureedge.net/Ubuntu_1804.2019.522.0_ARM64.appx",
"PackageFamilyName": "CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc"
},
{
"Name": "Ubuntu-20.04",
"FriendlyName": "Ubuntu 20.04 LTS",
"StoreAppId": "9N6SVWS3RX71",
"Amd64": true,
"Arm64": true,
"Amd64PackageUrl": "https://wsldownload.azureedge.net/Ubuntu_2004.2020.424.0_x64.appx",
"Arm64PackageUrl": "https://wsldownload.azureedge.net/Ubuntu_2004.2020.424.0_ARM64.appx",
"PackageFamilyName": "CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc"
},
{
"Name": "OracleLinux_8_5",
"FriendlyName": "Oracle Linux 8.5",
"StoreAppId": "9P06H18WXBVP",
"Amd64": true,
"Arm64": false,
"Amd64PackageUrl": "https://wslstorestorage.blob.core.windows.net/wslblob/OracleLinux8.5_8.5.1.0.Appx",
"Arm64PackageUrl": null,
"PackageFamilyName": "3810OracleAmericaInc.OracleLinux8.5_dm28ctvqnhe9g"
},
{
"Name": "OracleLinux_7_9",
"FriendlyName": "Oracle Linux 7.9",
"StoreAppId": "9P7L0QWBSLTK",
"Amd64": true,
"Arm64": false,
"Amd64PackageUrl": "https://wslstorestorage.blob.core.windows.net/wslblob/OracleLinux7.9_7.9.1.0.Appx",
"Arm64PackageUrl": null,
"PackageFamilyName": "3810OracleAmericaInc.OracleLinux7.9_dm28ctvqnhe9g"
}
]
}