<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On 2010年03月04日, at 12:33, Samuel Martín Moro wrote:</div><div><blockquote type="cite"><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">But there's still a thing I don't understand...</span><br></blockquote><blockquote type="cite"><div><div><div class="gmail_quote"><div><font face="courier new,monospace"><br></font></div><div><font face="courier new,monospace">in /etc/hosts, I have:</font></div><div><font face="courier new,monospace">10.0.0.1 toto-eth</font></div><div><font face="courier new,monospace">10.0.0.201 toto-wif</font></div><div><font face="courier new,monospace">88.191.xx.xx dedibox</font></div><div><font face="courier new,monospace"><br></font></div><div><font face="courier new,monospace">in /etc/dnsmasq.conf, I have:</font></div><div><font face="'courier new', monospace"><span style="font-family: arial; "><div><font face="courier new,monospace">dhcp-host=macaddr,10.0.0.1,infinite</font></div><div><font face="courier new,monospace"><span style="font-family: arial; "><div><font face="courier new,monospace">dhcp-host=macaddr,10.0.0.201,infinite</font></div><div><font face="courier new,monospace">cname=toto,toto-eth</font></div><div><font face="courier new,monospace">cname=mailbox,dedibox</font></div><div><font face="courier new,monospace"><br></font></div><div><font face="courier new,monospace">When I'm testing from the server, I can ping everyone.</font></div><div><font face="courier new,monospace">When I'm trying from a DHCP/DNS client from my network, toto and mailbox are not resolved.</font></div><div><font face="courier new,monospace">But, still trying from a client, when I nslookup them, I got my answer.</font></div></span></font></div></span></font></div></div></div></div></blockquote><div><br></div><div>If you are on Macs with Snow Leopard: They behave strangely and can exhibit the behavior you are describing. Here's what I've been able to ascertain:</div></div><div><br></div><div>* Open-source command line utilities work as expected because they utilize the well-known libraries.</div><div><br></div><div>* Native Mac (GUI) apps go through a intermediary process that caches / routes/ abstracts DNS, mDNS, X501 or whatever that is, and probably a couple other name services. As a "feature" introduced in Snow Leopard (OS X 10.6), this intermediary keeps track of which DNS server is responding fast enough. If your primary hiccups or goes offline for a bit, the order changes <i>and stays that way</i> unless/until the secondary hiccups and the primary proves, at that time, to be faster. (There is a similar feature in dnsmasq to ensure best performance, but you can override it with the --strict-order option. And it retries periodically, which OS X does not seem to.)</div><div><br></div><div>* For native (provided by Apple) command-line stuff, I'm not sure what goes which way.</div><div><br></div><div>As far as dnsmasq goes, this creates a problem if you've got your dnsmasq server set up as a primary and your upstream DNS provider set up as a secondary. It's all running along just fine for days, then the server has a senior moment and next thing you know the clients' native apps can't see your local servers, but if you try to diagnose it with the command line tools everything reports just fine.</div><div><br></div><div>The workaround: stick this in root's crontab (sudo crontab -e) to restart the cache/intermediary process once a minute:</div><div><div>* * * * * launchctl stop com.apple.mDNSResponder</div><div>The side effect of this is that every once in a while, the process gets whacked during a lookup and a process reports a server can't be found, mostly evident on web browsers. Hit reload and it all works.</div><div><br></div><div>I filed a bug report, and from other discussion lists I've seen others have too, but last I knew no official fix yet... it's not a bug, it's a feature.</div><div><br></div><div>Perette</div><div><br></div></div><div><div><br></div><div><br></div></div></body></html>