Portal Home > Knowledgebase > Articles Database > This is for all you "php_network_getaddresses: getaddrinfo failed:" sufferers


This is for all you "php_network_getaddresses: getaddrinfo failed:" sufferers




Posted by magneticmg, 04-14-2008, 10:07 AM
you can see this as well @ ijobid.com/cms/content/view/40/1/ SPENT A WEEK ON THIS. HOPE IT HELPS SOMEONE... got this: "php_network_getaddresses: getaddrinfo failed:" from using simplexml, fopen, etc. Like me, if you've had this message in your scripts, and can't figure out why, then you know the maddening fury that can accompany it .WHY OH WHY! My DNS zones are set properly, my Nameserver ips are there, my /etc/resolv.conf is good! What the hell? And what 's worse? My fopen, simplexml_load_file, (external file functions) were working properly a few weeks ago. THE POINT: My solution to this problem lay in the named.conf file and the fact that for some reason the :view "localhost_resolver" and view "internal" portions weren't in this file...? Something could have happened on my last build, or maybe while messing with the DNS in WHM, I don't know why they weren't, but they just weren't so check that to be sure! THE UBER-POINT I have had to learn over and over again, that if the issue is particularly challenging to you, go to the fundamentals, and work through them slowly. Learn about what you are trying to solve. It will undoubtedly take less time then mashing things together in a trial and error type fashion (which may inadvertently send you farther down the rabbit hole) Cameron. Last edited by magneticmg; 04-14-2008 at 10:13 AM.

Posted by ub3r, 04-14-2008, 10:12 AM
can you run rpm -qa | grep -i nameserver

Posted by magneticmg, 04-14-2008, 10:25 AM
Yup. My nameserver is working...

Posted by ub3r, 04-14-2008, 10:25 AM
Run it, send output.

Posted by magneticmg, 04-14-2008, 10:37 AM
Mike... I don't know if you read my post. I don't need assistance. I was just offering some help to people that may have run into this issue. I fix my problem, but thank you very much for offering to help. I don't want you to waste your time . Cheers

Posted by sirius, 04-14-2008, 10:46 AM
Moved to Technical and Security Issues.... Sirius

Posted by ub3r, 04-14-2008, 10:51 AM
If you run it, and you see a package named caching-nameserver, that's what had broken your dns setup.

Posted by JulesR, 04-14-2008, 11:01 AM
For the record, you missed a critical pat of the error message. There is usually another piece of the error after the "failed:" part, and it's often vital in determining the exact cause of the problem. In my experience having seen and dealt with 'getaddrinfo failed' errors, there's no generic global fix for all of them - they have to be treated individually.

Posted by magneticmg, 04-14-2008, 11:11 AM
Yes...how silly of me, since the error has disappeared for me I didn't have ready access to it. The second part of the error message was: Temporary failure in name resolution Sorry about that. Hope that makes it relevant to some. Cam

Posted by magneticmg, 04-14-2008, 11:15 AM
I get [root@server ~]# rpm -qa | grep -i nameserver caching-nameserver-9.3.4-8.P1.fc6 Is that what broke my set up before? Please elaborate..

Posted by JulesR, 04-14-2008, 11:33 AM
This error is almost exactly as it says - it temporarily failed to resolve the address in question. This can occur for multiple reasons and is generally down to a connection error to the nameservers listed in /etc/resolv.conf. Regardless, it should only ever be a temporary error, and if not then you have serious nameserver issues The most common way of working around this "hiccup" long-term (and also in some cases speeding up the script performing the connection) is to hard code the IP address of the host you're querying within your /etc/hosts file. This obviously removes the need for any DNS lookup which can save you significant time on busy boxes. The obvious drawback though, is that you need to ensure that the IP address is always kept up to date. Generally that's rarely an issue though. The other alternative I believe has already been mentioned; you can run a caching nameserver on the local machine and use this as your resolver. This should prove far more reliable than a remote nameserver, but obviously consumes more local resources.

Posted by ub3r, 04-14-2008, 01:05 PM
Basically, when that package was installed, it installed it's own version / config of bind, which randomly breaks most separate cpanel dns setups. The issue I ran into on centos installations was that the only way to complete a minimal linux installation was to go through the graphical installer, instead of what datacenters commonly use, text mode installation. I'm not sure if this was the case on fedora, as I have never found a reason to install it. However, both centos, fedora, and probably rhel installed the same basic packages during these days, and that in turn resulted in each setup breaking in the same way when cpanel was installed. This problem doesn't exist on centos 4.x, or 5.1 branches. Only 5.0 had the problem as far as I'm aware. Not totally sure about fedora though. Fedora's kind of a useless distribution these days.

Posted by magneticmg, 04-14-2008, 01:09 PM
Awesome, thanks mike... Great input. Cam

Posted by JulesR, 04-14-2008, 01:33 PM
That might be the case, but that should have nothing to do with the PHP script issue...



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read