Home > Blockchain >  HTTP request error: what is the distinction between "Name or service not known" and "
HTTP request error: what is the distinction between "Name or service not known" and "

Time:08-02

While scraping some sites with the requests package in python I came across these 2 Http Connection error's

  1. Name or service not known
ConnectionError: HTTPConnectionPool(host='1xbet666041.top', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f04cd03ab10>: Failed to establish a new connection: [Errno -2] Name or service not known'))
  1. Temporary failure in name resolution

ConnectionError: HTTPConnectionPool(host='1xbet666041.top', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fb9bacf7f10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')

Can any one please explain the difference between the 2 ?

Notice that I got these 2 different errors when using the same domain. The difference was that the first get call was made from DataBricks and the other from google collab.

Thanks.

CodePudding user response:

Name or service not known

A name resolution has been done, and it succeeded in getting a reply, but the reply was: "this name has no IP address". So it is a positive assertion on a negative result.

Temporary failure in name resolution

No name resolution was possible at all, so it is a negative assertion on the possibility of resolving that name.

Notice that I got these 2 different errors when using the same domain.

Yes, but using which nameserver(s)?

Assess your domain correct DNS configuration using a tool like DNSViz online. Any error has to be fixed, and warnings too.

  • Related