// mysql · security & access

skip_name_resolve

Do not resolve client host names; match accounts by IP address only.

Standard
OFF
Range
ON, OFF
Restart needed
Ja
Default checked on
MySQL 8.4 LTS

Was es bewirkt

Without it, every new connection may wait on a reverse DNS lookup, and account names like 'app'@'web1.example.com' depend on DNS.

Standardwert

OFF. OFF (MySQL 8.4). The official Docker image turns it ON in its config file, so variables_info shows it as ON with VARIABLE_SOURCE GLOBAL (the global option file).

Check the current value

SHOW GLOBAL VARIABLES LIKE 'skip_name_resolve';

SELECT VARIABLE_NAME, VARIABLE_SOURCE, MIN_VALUE, MAX_VALUE, SET_TIME
FROM performance_schema.variables_info
WHERE VARIABLE_NAME = 'skip_name_resolve';

Change it

SET PERSIST_ONLY skip_name_resolve = ON;
-- then restart mysqld (or set it under [mysqld] in my.cnf)

Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.

When to change it

Turn it on for faster, DNS-independent logins, after checking that no account uses a host name.

What can go wrong

Accounts defined with host names (other than localhost) stop matching.

Questions about skip_name_resolve

What is the default value of skip_name_resolve in MySQL?

OFF. OFF (MySQL 8.4). The official Docker image turns it ON in its config file, so variables_info shows it as ON with VARIABLE_SOURCE GLOBAL (the global option file).

Does changing skip_name_resolve require a restart?

Yes. Restart required: the variable is read-only at runtime (SET GLOBAL fails with error 1238). Stage it with SET PERSIST_ONLY or under [mysqld] in my.cnf.

When should I change skip_name_resolve?

Turn it on for faster, DNS-independent logins, after checking that no account uses a host name.

Back to all MySQL settings, or check the MySQL manual for every option.

// one client for every engine

Check skip_name_resolve on your own server

SQLly runs the query above against MySQL and the other engines in this reference, from one desktop app on macOS, Windows and Linux.