
When you verify a working Internet connection, ping a domain that you expect to be working (like ): If your computer cannot connect, you will see a message similar to this: In this case, we can get a response back from the server.

To find out if you are in fact connected to the Internet, ping Google's DNS server: Ping the desired domain name by executing the following command: ping Open a new command prompt by clicking the Windows button and typing cmd. The easiest way to figure out if this is the case, is to use the Ping command in Windows. The cause is most often a problem with the Internet connection or an invalid hostname (like the example in the previous section). Debugging the errorĪs promised, let's look at how to figure out why this error is happening. This will cause the WebException with a Status of NameResolutionFailure to be thrown. In the example, a request to the non-existing domain is made. Before we start digging into debugging, let's look at how web exceptions can be handled in C#: using System.Net Ĭatch (WebException e) when (e.Status = WebExceptionStatus.NameResolutionFailure) Handling the errorįiguring out why the DNS resolve fails can be everything from a piece of cake to extremely hard. When you HTTP request throws an exception, telling you that the remote name could not be resolved, it basically means that an IP address couldn't be solved from the provided domain name. You can think of DNS as the phonebook of the Internet. When returned, your client makes a request to the IP specified by the DNS. When you request, your client asks a DNS for the IP address of. So, what does "The remote name could not be resolved" mean? As you probably already know, requests over the Internet are made using a domain name system (DNS). In this post, we'll focus on resolving the remote name. Information that will help you debug what is going in. The exception type contains detailed information about the actual error that is happening. WebException is an umbrella-exception, used for a lot different errors when dealing with web requests in C#.

For this first installment, we'll take a look at with the message of "The remote name could not be resolved: 'name'". This is the first part of a new series named Debugging common.
