Getting Error: getaddrinfo ENOTFOUND for external API call.
I have shifted some of my company's infra to GCP. The issue I am facing is that suddenly out of the blue our GCP instances which are behind a VPC are giving us error
Error: getaddrinfo ENOTFOUND somedomain.xyz.in
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:26) {
errno: 'ENOTFOUND',
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'somedomain.xyz.in'
This error suddenly pops up and goes away automatically after sometime. Sometimes through one instance I am able to ping the above mentioned DNS whereas sometimes the SAME DNS is not ping-able from same instance. I have my billing etc all enabled. If someone has any solution please let me know.
Couple of more details :
- I am using Ubuntu18.04 LTS
- Instance on GCP are running a NODEJS program which pings the above mentioned external IP using HTTPS.
- The external service to which our system pings is hosted on Digital Ocean and is on Public IP and is mapped to a DNS.
- The call is made using
needlepackage of NPM.