Running PHP 5.6 on an EC2 instance with Apache 2.4.18, I'm occasionally seeing errors in the log when trying to connect to an RDS database:
PDO::__construct(): php_network_getaddresses: getaddrinfo failed: No address associated with hostname
The problem seems to be specific to php_network_getadresses from within Apache. Everything outside of Apache can resolve the host just fine and a test PHP script running inside Apache that uses gethostbyname can successfully do the DNS lookup, too.
So far the system hasn't been active long enough for me to discern a real pattern to the outages but I think they might be related to the RDS maintenance window during the night.
I have seen other users ask the same, both on SF, the AWS forums and elsewhere, but the "solution" seems to be to restart Apache every now and then. I find this very unsatisfactory however, so I'm wondering whether there are better, canonical solutions to this?