I want to resolve the "Name or service not known error" in Amazon Relational Database Service (Amazon RDS) for MySQL error logs.
Short description
When client authentication is in progress, Amazon RDS for MySQL performs a reverse DNS lookup on the client's hostname that's trying to connect. RDS for MySQL checks whether the hostname is in the host cache. If it doesn't exist, then the server resolves the IP address to a hostname and resolves the hostname back to an IP address. If RDS for MySQL can't perform the DNS lookup, then it logs one of the following error messages and continues the client authentication process:
"Host name could not be resolved: Name or service not known"
"IP address xxx.xxx.xxx.xxx/n could not be resolved: Name or service not known"
For a given host, RDS for MySQL only tries to perform a reverse DNS lookup for the first connection from that host. You won't see error messages for subsequent user connections from that host. Note that Amazon RDS intentionally limits a reverse DNS resolution for MySQL client connections within virtual private cloud (VPC) networks.
Note: In most cases, the preceding error messages can be ignored. However, the reverse DNS lookup process might cause a significant performance overhead and slow down the connection attempt.
Resolution
To resolve these error messages, turn on the skip_name_resolve parameter in a custom RDS for MySQL parameter group.
Complete the following steps:
- Create a custom parameter group in RDS for MySQL.
- Set the skip_name_resolve parameter to 1.
- Associate the custom parameter group with your RDS for MySQL instance.
- Reboot the instance to apply the custom parameter group.
Note: When you turn on the skip_name_resolve parameter, the parameter turns off reverse DNS lookup.
For more information, see DB parameter groups for Amazon RDS DB instances.
Related information
DNS lookups and the host cache on the MySQL website