question:
When we use Winget
the package manager to install software, we always get the following error.
执行此命令时发生意外错误:
InternetOpenUrl() failed.
0x80072efd : unknown error
Solution:
DNS is an important tool for converting web addresses into IP addresses. If your computer cannot access GitHub, it is most likely due to a DNS failure. Methods to solve such problems include modifying the DNS server, using a DNS service provider that can prevent DNS pollution, or using a VPN to avoid DNS resolution problems.
At this time, you only need to modify the host file and write the accessible dns resolution address.
Steps
- Adding to the hosts file can resolve the IP normally.
Execute the CMD command line with administrator rights and enter the following command:
echo 20.205.243.166 github.com >> c:\Windows\System32\drivers\etc\hosts
echo 199.232.5.194 github.global.ssl.fastly.net >> c:\Windows\System32\drivers\etc\hosts
echo 151.101.100.133 raw.githubusercontent.com >> c:\Windows\System32\drivers\etc\hosts
- Flush dns cache
ipconfig/flushdns
Install the application using Winget command
winget
At this point , you can install the application normally through