Hello, when switching my laptop from LAN to a dialup connection, applications started _before_ the switch will still try to send DNS queries to my local DNS server. This isn't ideal, and the only workaround I've found so far is to restart the application. Is the resolver supposed to periodically check for updates to the resolv.conf, or are the applications somehow caching the IP of the DNS server? Ulrich Spoerlein -- PGP Key ID: 20FEE9DD Encrypted mail welcome! Fingerprint: AEC9 AF5E 01AC 4EE1 8F70 6CBD E76E 2227 20FE E9DD Which is worse: ignorance or apathy? Don't know. Don't care.
> Is the resolver supposed to periodically check for updates to the > resolv.conf, or are the applications somehow caching the IP of the DNS > server?No, resolv.conf is only read once when the resolver routines initialize. The solution is to run a local caching nameserver instance. You should do this anyway, for performance reasons. Add 'named_enable="YES"' to /etc/rc.conf, and modify your /etc/dhclient.conf as follows: interface "ath0" { supersede domain-name "orthanc.ca"; supersede domain-name-servers 127.0.0.1; } interface "bge0" { supersede domain-name "orthanc.ca"; supersede domain-name-servers 127.0.0.1; } Change the domain string to something more appropriate, and adjust the interface names to match your laptop. You'll need to start named and restart the dhclient instances (in that order) for the changes to take effect. --lyndon
Hi,>>>>> On Wed, 5 Apr 2006 17:27:19 +0200 >>>>> Ulrich Spoerlein <spoerlein@googlemail.com> said:spoerlein> Is the resolver supposed to periodically check for updates to the spoerlein> resolv.conf, or are the applications somehow caching the IP of the DNS spoerlein> server? Traditionally, the resolver doesn't reread resolv.conf. It is not useful for especially mobile environment. So, I wrote a patch to reread resolv.conf in past. Recently, I noticed that it could be implemented as a NSS plug-in, and made it just today. You can get it from: http://www.imasy.or.jp/FreeBSD/nss_resinit-20060408.tar.gz I don't write any documentation, yet. But, it should work by changing `hosts' entry in /etc/nsswitch.conf to the following line: hosts: resinit files dns It seems working on my 7-CURRENT box and 6-STABLE box. However, it should be tested more. Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/
Hi,>>>>> On Fri, 7 Apr 2006 12:15:54 -0400 >>>>> "Rong-En Fan" <grafan@gmail.com> said:grafan> The file is not there. I got 404. Oops, it should be: http://www.imasy.or.jp/~ume/FreeBSD/nss_resinit-20060408.tar.gz Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/
> when switching my laptop from LAN to a dialup connection, applications > started _before_ the switch will still try to send DNS queries to my > local DNS server. This isn't ideal, and the only workaround I've found > so far is to restart the application. > > Is the resolver supposed to periodically check for updates to the > resolv.conf, or are the applications somehow caching the IP of the DNS > server?If you're the author of the application you can periodically unset a RES_INIT bit mask option in _res.options. Next time your application will try to call res_send() it will call res_init() at first. This is according to a resolver(3) manual page.