List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:May 19 2011 2:27pm
Subject:Re: Interesting bug/oversight
View as plain text  
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
Interesting bug/oversightJohan De Meersman19 May
  • Re: Interesting bug/oversightClaudio Nanni19 May
    • Re: Interesting bug/oversightJohan De Meersman19 May
  • Re: Interesting bug/oversightDan Nelson19 May
    • Re: Interesting bug/oversightJohan De Meersman19 May