How do I resolve the name or service not known error in Amazon RDS for MySQL?

2 minute read
0

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, MySQL performs a reverse DNS lookup on the hostname of the client that is trying to connect. MySQL checks if the hostname is present in the host cache. If it's not present, then the server resolves the IP address to a hostname and resolves the hostname back to an IP address. If MySQL can't perform the DNS lookup, then MySQL 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 X.X.X.X could not be resolved: Name or service not known

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:

Note: Turning on the skip_name_resolve parameter turns off reverse DNS lookup.

  1. Create a custom RDS for MySQL parameter group.
  2. Set the skip_name_resolve parameter to 1.
  3. Associate the custom parameter group with your RDS for MySQL instance.
  4. Reboot the instance to apply the custom parameter group.

For more information, see Working with DB parameter groups.

Related information

DNS Lookups and the Host Cache on the MySQL website

AWS OFFICIAL
AWS OFFICIALUpdated 7 months ago