Blog Post

IIS Support Blog
1 MIN READ

“No such host is known” error in Visual Studio

Nedim's avatar
Nedim
Former Employee
Feb 11, 2019

Error messages like “Socket Exception: No such host is known” refers to issues in the code or configuration of your application. Here is an example error message:

 

System.Net.Sockets.SocketException: No such host is known

 

Root cause

In my case, the root cause was a failure in DNS name resolution. The application was trying to call an API but it is not able to find the hostname.

 

Solution

Your server should be able to access to the DNS server. Additionally, your DNS server should be able to lookup the hostname that is in your code. Troubleshooting steps:

  • Run ipconfig /all in Command Prompt. Fin the IP addresses of the DNS server in the output. Try to ping it.
  • Run nslookup. Enter the hostname from your code. The DNS server should be able to reach this hostname.
  • Make sure there is no typo or white spaces in the hostname. In case you are getting this input from a JSON call or configuration file, the source string and the variable might have different values.
Updated Feb 11, 2019
Version 2.0
No CommentsBe the first to comment