I'm running MySQL5.6.3 on a CentOS 6.1 virtual machine running on Windows XP in VirtualBox.

The network card is configured in bridge mode, so my physical & virtual machines share the same ethernet card.

On the virtual machine, everything works fine: internet access, DNS lookups. However, connections to the MySQL daemon take a while, and the logs keep showing this warning:

[Warning] IP address '192.168.1.201' could not be resolved: Temporary failure in name resolution

192.168.1.201 is my host machine on which I'm runnning the MySQL client.

Looks like although DNS lookups work fine, reverse DNS lookups end up in a timeout.

Here is the virtual machine configuration:

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR="08:00:27:4B:3D:7C"
NM_CONTROLLED="yes"
ONBOOT="yes"
NETMASK=255.255.255.0
IPADDR=192.168.1.200
GATEWAY=192.168.1.1
PEERDNS=yes

# cat /etc/resolv.conf
nameserver 192.168.1.1

Is there something wrong in my network configuration?

link|improve this question

feedback

1 Answer

up vote 5 down vote accepted

IMHO This sounds like you need mysqld to stop using DNS.

Please do the following: Add this to /etc/my.cnf

[mysqld]
skip-host-cache
skip-name-resolve

Them restart mysql. From then on, mysql will no longer resolve addresses via DNS.

Give it a Try !!!

CAVEAT

Please read these options in the MySQL Documentation:

Also, there is one restriction to using this: You cannot use DNS names in the host column of any of the grant tables.

link|improve this answer
That works fine, thanks! – Benjamin Dec 15 '11 at 17:26
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.