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 Fri, Jul 23, 2004 at 11:52:54AM +0200, 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?

Another way to do it is to refer a globally accessibe name server,
or have your own nameserver running at the laptop, and then from there 
refer to globally accessible nameservers.

Using tcpdump I was quite astonished over the number of nameserver
references that is going on all the time. So maybe, to reduce 
DNS traffic, you should just install the nameserver on the laptop.

Best regards
keld


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