Hi,
I send a http request to my server (cloud) and sometimes (about one for ten requests), I get “Error: getaddrinfo ENOTFOUND”. When I replace in the URL the domain name by the server’s IP, it works perfect.
I read in nodejs docs/forums that it could be a IPV4 / IPV6 issue in DNS resolution, and then I should set http request’s option ‘family’ to 4, to be sure that it will use IPV4.
I added this option value in a function before the http request node :
var newMsg = {
payload: msg,
family: 4,
headers: {
"Content-type" : "application/json"
}
};
return newMsg;
But same result (ENOTFOUND errors sometimes).
I’ve checked that ipV6 is not enabled (no inet6 IP displayed with ifconfig and no ipv6 setup panel).
Is there a better way to specify the family
option of the http request node ?
Is there another explication ?
Thanks.