node-yahoo-finance2
node-yahoo-finance2 copied to clipboard
Error: getaddrinfo EAI_AGAIN finance.yahoo.com
I'm getting the error in the picture below. The app was working perfectly. But today i got this error. On localhost app is working. But in real project im getting this error. So i suspected whether i blocked by yahoo or not?
EAI_AGAIN
is a DNS timeout error. While it is in theory possible that Yahoo could be blocking server farms at this level, it's very, very unlikely. More likely one of their or your / your ISPs DNS servers / network has (or had) an issue (and it's stuck in the cache). Easiest fix if you, if you have access to your DNS settings, is to simply switch to a public DNS server like Google's (8.8.8.8, 8.8.4.4) or Cloudflares (1.1.1.1) and it should fix your problem.
You can experiment a big with dig
, e.g.
$ dig a finance.yahoo.com @your-dns-server # from /etc/resolve.conf
$ dig a finance.yahoo.com @8.8.8.8
Note that the public DNS servers (and presumably Yahoo's) are anycast IPs, so doing the above from system could give differing results depending on geolocation and cache issues.
Let us know :)
I think i managed to change the dns by using netplan. I'm not good at ubuntu server... I reboot the server but im getting the same error unfortunately...
Thanks for your help. You are very helpful...
Looks like you got it but I'm not familiar with netplan either.
Can you paste the results of dig a query2.finance.yahoo.com
?
(Amongst other things, it will tell you which DNS server is used, near the bottom... but also the results of the query).
What's in your /etc/resolv.conf
?
I think in new versions of ubuntu netplan is being used for dns changing. I changed from there and there is no resolv.conf.
After i try with dig i saw that server was using previous dns. It wanst google dns. I think we should wait for a while for dns changing. Now it is working.
Thanks a lot for your help. Your are great...
Ok great thanks for reporting back! Glad you're up and running again.
Actually leaving this open, this does happen occasionally and perhaps we should document it somewhere.