D
D
Dima Avdoshin2021-03-30 19:52:08
ASP.NET
Dima Avdoshin, 2021-03-30 19:52:08

How can I fix the error Unable to resolve remote name: >?

Good afternoon
When I make a request to the site on my computer, everything is OK
When I try to make a request from the server, I get an error Cannot resolve the remote name:
on the server itself, everything goes fine through the address bar and through ping, the problem is when I send a request from the application
I access the site with the following get request

try
            {

                var request = (HttpWebRequest)WebRequest.Create(URL);
                request.Credentials = CredentialCache.DefaultCredentials;
                WebResponse webResponse = request.GetResponse();
                Stream webStream = webResponse.GetResponseStream();
                StreamReader responseReader = new StreamReader(webStream);
                return responseReader.ReadToEnd();
            }
            catch (WebException e)
            {
                //
                var we = e.Response as HttpWebResponse;

                //AddRecordJournal(message,(int)we.StatusCode);
                //
                return "Error " + e.Message;
            }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dima Avdoshin, 2021-04-01
@D1m0nd

Maybe you have my case 1. Check the settings of the dns
server, my main dns server was problematic, I indicated the main one as an alternative, the alternative was 1.1. connect> <address of your dns server, main or alternative> example nslookup fb.com 1.1.1.1 If you have one true different runtime, then look for a problem in your dns server, I did not take a steam bath and indicated the alternative as the main one, because the situation allowed otherwise try step two 2. find out the address of the host query it or enable this add-on
3. Also, you may not be allowed in because of the protocol, try changing from http to https and vice versa, this may also work

B
BasiC2k, 2021-03-30
@BasiC2k

Do you have an https or http link?
Try to add before creating request:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls
(this is VB)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question