6

I have node.js server which acts like a proxy. It receives requests and forwards them to web service on another domain, by executing http.request.

Request options usually are similar to:

{
  "host": "some.domain",
  "port": 443,
  "path": "/paht/item/id",
  "method": "POST",
  "headers": {
    "Host": "some.domain",
    "Content-Type": "application/json; charset=utf-8",
    "Content-Length": 100
  }
}

Lately, I've noticed that some requests fail with [Error: getaddrinfo EADDRINFO], but not all of them.

Does anyone know what EADDRINFO means, and what the alleged cause can be?

WEFX
  • 8,298
  • 8
  • 66
  • 102
aliona
  • 447
  • 1
  • 6
  • 18

1 Answers1

14

EAADRINFO is an error type that can occur when looking up a host name's IP address for the case where an IP address cannot be found. So here it likely means that the "some.domain" value of the request can't be resolved to an IP address.

JohnnyHK
  • 305,182
  • 66
  • 621
  • 471
  • 2
    JohnnyHK, thanks for the reply. But the strangest thing is that I'm sending request to the same host name all the time and sometimes request fails, other times domain name is successfully resolved – aliona Sep 24 '12 at 18:43
  • 2
    @aliona As a test, try replacing the host name with its IP address and see if the errors go away. If they do, perhaps your DNS server or config is dodgy. – JohnnyHK Sep 24 '12 at 18:51