The browser can directly access the url to download resources, but an error is reported through programming or the command line (ping domain name), indicating that the host cannot be resolved

zhihao huang 20 Reputation points
2023-04-18T03:10:41.35+00:00

My application runs normally on the windows system until an error is reported when running on a Norwegian win11 virtual machine. The log indicates that the host name cannot be resolved (use HttpClient). I also report an error in the command line (cmd.exe), but in the browser It works fine, does anyone know what the problem is? Thanks.

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,155 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Limitless Technology 43,931 Reputation points
    2023-04-18T14:48:06.6933333+00:00

    Hello there, Can you please share the exact error message that your are getting? There are several points that you need to check. 1.Check that the name is correctly sepcified 2.Verify that there is network connectivity as this is required to communicate with the DNS servers used to resolve a hostname 3.Check that the DNS server address is correct especially if they are configured statically 4.Check the firewall on server computer, try turn off your firewall which maybe block your program from accessing the internet Hope this resolves your Query !! --If the reply is helpful, please Upvote and Accept it as an answer--