phil has a blog - MySQL DNS Details - 10 second timout

MySQL DNS Details - 10 second timout

“Standard C library gethostbyaddr() uses /etc/resolv.conf. (For our purpose here we forget about /etc/hosts which might also be used.) It queries each listed nameserver twice in order, waiting 5 seconds for each one. For example, if /etc/resolv.conf lists 2 nameservers, the first is queried, then the second, then the first again, then the second again. Therefore the maximum wait time for gethostbyaddr() is 10 seconds times the number of nameservers.

For MySQL this means, if no nameserver in /etc/resolv.conf responds, it takes a minimum of 10 seconds to fail, but only for the first time for the same IP address because this failure will be cached. “