This error popped on one of my clients website and it got me stumped. Through SSH, the DNS seemed to work fine. I could run host domain.com, curl, wget, etc - but when php would try to load the url, it failed with the above error. I tried setting different DNS resolver servers, restarted services, and checked for config errors but could not find the source of this problem. So I then turned to google.