From: Dan Nelson Date: May 19 2011 2:27pm Subject: Re: Interesting bug/oversight List-Archive: http://lists.mysql.com/mysql/225043 Message-Id: <20110519142703.GE34082@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (May 19), Johan De Meersman said: > I use DNS names instead of IPs in mysql grants. Yes, I'm aware of the > performance impact, that's not an issue. > > I just found out through failing logins that a server was still connecting > to an old DNS server, and properly updated the resolv.conf. Commandline > host lookups then returned correct results. > > However, even after repeated flush hosts commands, the MySQL kept > returning wrong results. Only after a full restart did it pick itself up > and start doing proper lookups. I strongly suspect that this is due to it > internally caching the nameserver, too, and not refreshing that along with > the host cache on a flush hosts command. > > Can anyone confirm this is the case, and wether or not a bug has been > logged about it? I can't seem to find one. I doubt that mysql calls anything other than gethostbyname() or getaddrinfo(), so your behaviour is probably dependant on whatever OS you are running and how often its local resolver re-checks resolv.conf. Usually that's only once when a program starts. If you're running bind, nscd, or some other intermediate DNS client on your machine, bouncing that should work. If not, you'll need to bounce mysql. -- Dan Nelson dnelson@stripped