This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Improved DNS resolving for laptops?


On Friday 23 July 2004 12:52, Petter Reinholdtsen wrote:
> My laptop moves from network to network.  The network configuration is
> updated using DHCP, but the DNS resolver info is not as easy to
> update.  The file /etc/resolv.conf is updated by the DHCP client, but
> the programs do not re-read this file once they are started.  This is
> a problem for long-lived programs, and for my laptop this means it is
> a problem for most programs (hibernate works. :).
>
> Here is an idea on how to make it possible to solve this, without
> affecting all users of the resolver functions.  The idea consist of
> two parts:
>
>  - Every time a DNS lookup fail, (or only when a specificed time
>    period has elapsed since the last check), stat /etc/resolv.conf,
>    and if this file changed, reread it by calling res_init().
>
>  - Make the new behaviour optional using a flag in /etc/host.conf.
>    This way only the hosts in need of this dynamic rebinding would
>    enable it, and the others would keep working as before.
>
> There could also be a flag to make the resolver check the timestamp of
> resolv.conf ever X seconds.  This would make sure programs start using
> the new content even if the old DNS server is still replying to
> queries.
>
> Do you think this would work?

Run dnscache on your box. Restart it every time your
DNS servers change. Or run it in 'go to root servers' mode,
in that mode it need not be restarted at all.

Point /etc/resolv.conf to 127.0.0.1. This address is
unlikely to ever charge :)

> There is a similar problem with /etc/localtime when moving my laptop
> from timezone to timezone, but I'm not sure how that could be solved
> without stat()ing the file every time localtime() is called.  And I
> don't want that.
-- 
vda


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]