Re: Working with a local DNS cache

2009-10-01 Thread Dan Williams
On Thu, 2009-10-01 at 14:28 -0700, Adam Langley wrote:
> On Thu, Oct 1, 2009 at 2:17 PM, Dan Williams  wrote:
> > Is that something you intend to ship and support going forward, ie a
> > tool that distros should start including alongside dnsmasq and the like?
> 
> If there was interest, yes. However, if you're just looking for
> dnsmasq or BIND DBus support (or anything else) before considering the
> patch, just let me know and I'll add it.

Nope, just bandwidth.  The coding style readme update was a good
addition, thanks for that.

Dan


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-10-01 Thread Adam Langley
On Thu, Oct 1, 2009 at 2:17 PM, Dan Williams  wrote:
> Is that something you intend to ship and support going forward, ie a
> tool that distros should start including alongside dnsmasq and the like?

If there was interest, yes. However, if you're just looking for
dnsmasq or BIND DBus support (or anything else) before considering the
patch, just let me know and I'll add it.

Cheers


AGL

-- 
Adam Langley a...@imperialviolet.org http://www.imperialviolet.org
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-10-01 Thread Dan Williams
On Wed, 2009-09-23 at 11:54 -0700, Adam Langley wrote:
> On Tue, Sep 22, 2009 at 11:11 PM, Dan Williams  wrote:
> > Colin and I discussed this last week too; is the Chromium cache a
> > machine-global cache (ie, running other programs would also route
> > requests through the cache), or does Chromium want the DNS data in
> > parallel with the normal glibc resolver?  Seems like it is a global
> > cache, right?
> 
> Sorry, I think the word 'Chromium' is confusing here (which is
> probably my fault since I introduced it). Chromium is just another
> process which uses DNS (although it's a pretty heavy user due to
> prefetching[1]). There's a DNS cache inside of Chromium itself, but
> it's very short lived (on the order of a few seconds) and exists only
> to merge DNS lookups when we simultaneously open multiple connections
> to the same host. This cache is per browser process.
> 
> The DNS cache which implements the DBus interface[2] is a real DNS
> cache and is designed to be machine global. (It's a hacked up version
> of djbdns[3]). It exists only because I'm sure that some distros would
> balk at including BIND by default and I wanted another answer if/when
> I try to get them to enable local DNS caching by default. The DBus
> interface name includes 'chromium' only because I didn't have a better
> name at the time. It's nothing to do with the Chromium codebase.

Is that something you intend to ship and support going forward, ie a
tool that distros should start including alongside dnsmasq and the like?

Dan


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-09-23 Thread Adam Langley
On Tue, Sep 22, 2009 at 11:11 PM, Dan Williams  wrote:
> Colin and I discussed this last week too; is the Chromium cache a
> machine-global cache (ie, running other programs would also route
> requests through the cache), or does Chromium want the DNS data in
> parallel with the normal glibc resolver?  Seems like it is a global
> cache, right?

Sorry, I think the word 'Chromium' is confusing here (which is
probably my fault since I introduced it). Chromium is just another
process which uses DNS (although it's a pretty heavy user due to
prefetching[1]). There's a DNS cache inside of Chromium itself, but
it's very short lived (on the order of a few seconds) and exists only
to merge DNS lookups when we simultaneously open multiple connections
to the same host. This cache is per browser process.

The DNS cache which implements the DBus interface[2] is a real DNS
cache and is designed to be machine global. (It's a hacked up version
of djbdns[3]). It exists only because I'm sure that some distros would
balk at including BIND by default and I wanted another answer if/when
I try to get them to enable local DNS caching by default. The DBus
interface name includes 'chromium' only because I didn't have a better
name at the time. It's nothing to do with the Chromium codebase.

I hope that clears things up.


Cheers

AGL

[1] http://blog.chromium.org/2008/09/dns-prefetching-or-pre-resolving.html
[2] http://github.com/agl/local-dns-cache
[3] http://cr.yp.to/djbdns.html

-- 
Adam Langley a...@imperialviolet.org http://www.imperialviolet.org
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-09-22 Thread Dan Williams
On Thu, 2009-09-10 at 14:28 -0700, Adam Langley wrote:
> On Wed, Aug 26, 2009 at 4:08 PM, Adam Langley  wrote:
> > As ever, the patches are at 
> > http://github.com/agl/NetworkManager/commits/agl3
> 
> Since Dan seems to be doing a batch of email replies right now, I'm
> just bumping this thread ;)

Colin and I discussed this last week too; is the Chromium cache a
machine-global cache (ie, running other programs would also route
requests through the cache), or does Chromium want the DNS data in
parallel with the normal glibc resolver?  Seems like it is a global
cache, right?

Dan


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-09-10 Thread Adam Langley
On Wed, Aug 26, 2009 at 4:08 PM, Adam Langley  wrote:
> As ever, the patches are at http://github.com/agl/NetworkManager/commits/agl3

Since Dan seems to be doing a batch of email replies right now, I'm
just bumping this thread ;)


AGL

-- 
Adam Langley a...@imperialviolet.org http://www.imperialviolet.org
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-26 Thread Adam Langley
On Fri, Aug 21, 2009 at 8:04 AM, Dan Williams wrote:
> Overall, approach looks pretty good.  I wont' subject you to
> GInterface/GObject if you don't volunteer for it (though I'd be happy to
> guide) so let me know when you've got the style cleanups and I'll run
> through again.  Thanks!

I rewrote the patch series to use a GObject interface (I think; I've
never used GObject before, so I'm a little unsure).

As ever, the patches are at http://github.com/agl/NetworkManager/commits/agl3


Cheers

-- 
Adam Langley a...@imperialviolet.org http://www.imperialviolet.org
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-21 Thread Howard Chu

Date: Fri, 21 Aug 2009 13:53:10 -0700
From: Adam Langley


Just for reference, I've been running with my patch

http://bugzilla.gnome.org/show_bug.cgi?id=551747

for the past several months. It should be pretty trivial to merge/paste it 
into what you're doing. Would be nice to be able to stop having to build this 
custom for all of my machines.



On Fri, Aug 21, 2009 at 8:04 AM, Dan Williams  wrote:

Well, Marcel had some valid issues with dnsmasq, and others may want to
use bind, so in the end we probably want a GInterface for this and then
have classes that implement the GInterface for each of the specific
caching name daemons. ?I don't really have a problem with that; we'll
probably have to add arguments and a config file option for which one
you want to use, because people may want to use dnsmasq underneath
chromium too and have chromium still use 127.0.0.1.


I only wrote the code using org.chromium.LocalDNSCache because that's
what I have running here. For the final version, I think it should use
the dnsmasq interface[1]. I've no desire to fork interfaces with out a
good reason. (The dnsmasq interface isn't very pretty, but I don't
know if that's a good enough reason.)

I'd be happy to write a GInterface to abstract the configuration if
that's what's needed. But shouldn't DBus *be* that interface? I
suppose if BIND isn't going to implement a DBus interface then we have
little choice, but rewriting BIND configs is a rather scary
proposition. Would people want a templating system in order to have
NetworkManager write a config which preserved their BIND preferences?

[1] http://www.thekelleys.org.uk/dnsmasq/docs/DBus-interface


No problem; everyone has their own. ?A few of the guidelines are
documented in the CONTRIBUTING but I see now that I should extend that
significantly.

A few style comments...


Thanks! Hopefully I've fixed up those style issues. (Note: rebased on
top of up-to-date tree). Also updated the CONTRIBUTING file with some
of your style points:

http://github.com/agl/NetworkManager/commits/agl



--
  -- Howard Chu
  CTO, Symas Corp.   http://www.symas.com
  Director, Highland Sun http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-21 Thread Marcel Holtmann
Hi Adam,

> > Well, Marcel had some valid issues with dnsmasq, and others may want to
> > use bind, so in the end we probably want a GInterface for this and then
> > have classes that implement the GInterface for each of the specific
> > caching name daemons.  I don't really have a problem with that; we'll
> > probably have to add arguments and a config file option for which one
> > you want to use, because people may want to use dnsmasq underneath
> > chromium too and have chromium still use 127.0.0.1.
> 
> I only wrote the code using org.chromium.LocalDNSCache because that's
> what I have running here. For the final version, I think it should use
> the dnsmasq interface[1]. I've no desire to fork interfaces with out a
> good reason. (The dnsmasq interface isn't very pretty, but I don't
> know if that's a good enough reason.)

in this case it is, because it is bluntly overloading one method call
like crazy. And there is also no way to determine which settings are
currently used by dnsmasq. That is pretty bad.

Regards

Marcel


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-21 Thread Adam Langley
On Fri, Aug 21, 2009 at 8:04 AM, Dan Williams wrote:
> Well, Marcel had some valid issues with dnsmasq, and others may want to
> use bind, so in the end we probably want a GInterface for this and then
> have classes that implement the GInterface for each of the specific
> caching name daemons.  I don't really have a problem with that; we'll
> probably have to add arguments and a config file option for which one
> you want to use, because people may want to use dnsmasq underneath
> chromium too and have chromium still use 127.0.0.1.

I only wrote the code using org.chromium.LocalDNSCache because that's
what I have running here. For the final version, I think it should use
the dnsmasq interface[1]. I've no desire to fork interfaces with out a
good reason. (The dnsmasq interface isn't very pretty, but I don't
know if that's a good enough reason.)

I'd be happy to write a GInterface to abstract the configuration if
that's what's needed. But shouldn't DBus *be* that interface? I
suppose if BIND isn't going to implement a DBus interface then we have
little choice, but rewriting BIND configs is a rather scary
proposition. Would people want a templating system in order to have
NetworkManager write a config which preserved their BIND preferences?

[1] http://www.thekelleys.org.uk/dnsmasq/docs/DBus-interface

> No problem; everyone has their own.  A few of the guidelines are
> documented in the CONTRIBUTING but I see now that I should extend that
> significantly.
>
> A few style comments...

Thanks! Hopefully I've fixed up those style issues. (Note: rebased on
top of up-to-date tree). Also updated the CONTRIBUTING file with some
of your style points:

http://github.com/agl/NetworkManager/commits/agl


Cheers

AGL

-- 
Adam Langley a...@imperialviolet.org http://www.imperialviolet.org
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-21 Thread Dan Williams
On Fri, 2009-08-14 at 13:12 -0700, Adam Langley wrote:
> On Fri, Aug 7, 2009 at 4:45 PM, Adam Langley wrote:
> > It appears that I need to make the IP config code asynchronous as a
> > first step. I'll start hacking on that.
> 
> Please see the commits at http://github.com/agl/NetworkManager/commits/agl
> 
> (is that a good way to post patches? If not, what would folks prefer?)
> 
> I did a couple of refactoring commits ([1][2]) which just make it
> easier to add a DBus call in the right place. Then the 3rd commit[3]
> adds support for org.chromium.local-dns-cache. As you mentioned, we
> probably want to use the dnsmasq interface[4], it's just that I happen
> to have a caching server which implements org.chromium.local-dns-cache
> and so I used that for testing. If/when you're happy with the code
> I'll spin up dnsmasq and make sure it works with that.

Well, Marcel had some valid issues with dnsmasq, and others may want to
use bind, so in the end we probably want a GInterface for this and then
have classes that implement the GInterface for each of the specific
caching name daemons.  I don't really have a problem with that; we'll
probably have to add arguments and a config file option for which one
you want to use, because people may want to use dnsmasq underneath
chromium too and have chromium still use 127.0.0.1.

> I'm not really familiar with glib coding styles so please forgive and
> correct any incorrect mannerisms.

No problem; everyone has their own.  A few of the guidelines are
documented in the CONTRIBUTING but I see now that I should extend that
significantly.

A few style comments...

Keep a space between the function name and the opening '(' (patch #2,
new line 502 + 505 + etc).  Also keep C-style comments (except for
FIXMEs, stupid I know).  Please also use inet_pton/inet_ntop instead of
inet_ntoa (3rd patch new line 549).  Next, I generally try to keep
assignments in the variable declaration area pretty short (just
constants or other variables, not function results), so stuff like this:

+  NMNamedManagerPrivate *priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr);
+  NMDBusManager *dbus_mgr = nm_dbus_manager_get();
+  priv->has_dbus_resolver =
+nm_dbus_manager_name_has_owner(dbus_mgr, LOCAL_CACHE_DBUS_NAME);

should be:

  NMNamedManagerPrivate *priv = NM_NAMED_MANAGER_GET_PRIVATE (mgr);
  NMDBusManager *dbus_mgr;

  dbus_mgr = nm_dbus_manager_get();
  priv->has_dbus_resolver = nm_dbus_manager_name_has_owner (dbus_mgr, 
LOCAL_CACHE_DBUS_NAME);

80 cols is also a guide not a rule, so if looks like ass to wrap the
line (especially on assignments) then just go over 80 cols.

Next, variable names should be lower-case with _ as the separator
instead of kMaxNameservers; in the case of kMaxNameservers which is a
constant, it should be #defined somewhere above like so:

#define MAX_NAMESERVERS 16

static gboolean
dispatch_local_cache (NMNamedManager *mgr, NMResolvConfData *rc,
NMResolvConfCallback callback, void *data)
{
  NMDBusManager *dbus_manager = nm_dbus_manager_get();
  DBusGConnection *conn = nm_dbus_manager_get_connection(dbus_manager);
  DBusGProxy *proxy;
  guint32 ips_uint32[MAX_NAMESERVERS];

Overall, approach looks pretty good.  I wont' subject you to
GInterface/GObject if you don't volunteer for it (though I'd be happy to
guide) so let me know when you've got the style cleanups and I'll run
through again.  Thanks!

Dan


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-21 Thread Dan Williams
On Thu, 2009-08-20 at 11:01 -0700, Adam Langley wrote:
> On Fri, Aug 14, 2009 at 1:12 PM, Adam Langley wrote:
> > (is that a good way to post patches? If not, what would folks prefer?)
> 
> Ping. Just being a squeaky wheel here!
> 

Sorry!  Trying to clean up some loose ends here before a 0.7.2 release
and a few other things.  Will try to look today.

Dan


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-20 Thread Adam Langley
On Fri, Aug 14, 2009 at 1:12 PM, Adam Langley wrote:
> (is that a good way to post patches? If not, what would folks prefer?)

Ping. Just being a squeaky wheel here!


AGL

-- 
Adam Langley a...@imperialviolet.org http://www.imperialviolet.org
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-14 Thread Adam Langley
On Fri, Aug 7, 2009 at 4:45 PM, Adam Langley wrote:
> It appears that I need to make the IP config code asynchronous as a
> first step. I'll start hacking on that.

Please see the commits at http://github.com/agl/NetworkManager/commits/agl

(is that a good way to post patches? If not, what would folks prefer?)

I did a couple of refactoring commits ([1][2]) which just make it
easier to add a DBus call in the right place. Then the 3rd commit[3]
adds support for org.chromium.local-dns-cache. As you mentioned, we
probably want to use the dnsmasq interface[4], it's just that I happen
to have a caching server which implements org.chromium.local-dns-cache
and so I used that for testing. If/when you're happy with the code
I'll spin up dnsmasq and make sure it works with that.

I'm not really familiar with glib coding styles so please forgive and
correct any incorrect mannerisms.


Cheers

AGL


[1] 
http://github.com/agl/NetworkManager/commit/2f594fc2b66b9328cb669ce1cccb3bd8a0042260
[2] 
http://github.com/agl/NetworkManager/commit/8227904ab3eb0a69d9d6ff3c38ddd61aaac3408d
[3] 
http://github.com/agl/NetworkManager/commit/940aa0db9019220d6c7a43b8626478319aa51f73
[4] http://www.thekelleys.org.uk/dnsmasq/docs/DBus-interface

-- 
Adam Langley a...@imperialviolet.org http://www.imperialviolet.org
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-07 Thread Adam Langley
On Fri, Aug 7, 2009 at 3:25 PM, Paul Wouters wrote:
> If imposing a local DNS cache, please use Unbound or Bind, as those
> are currently the only ones supporting DNSSEC.

For the purposes of NetworkManager, so long as the DBus interface
exists, the underlying server doesn't matter.

It appears that I need to make the IP config code asynchronous as a
first step. I'll start hacking on that.


AGL

-- 
Adam Langley a...@imperialviolet.org http://www.imperialviolet.org
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-07 Thread Dan Williams
On Fri, 2009-08-07 at 18:25 -0400, Paul Wouters wrote:
> On Fri, 7 Aug 2009, Dan Williams wrote:
> 
> >>> The most common local caching nameserver is currently dnsmasq, and it
> >>> also provides a D-Bus interface.  If at all possible, we should try to
> >>> use *one* dbus interface.  Not sure if you've looked at the dnsmasq dbus
> >>> API, but it might be worth a glance.
> >>
> >> I did look at it. It is the worst D-Bus API I have seen in a long time
> >> and not helpful. Someone would have to fix it first. The amount of
> >> parameter overloading it does is just insane. Otherwise dnsmasq has a
> >> pretty nice set of features.
> >
> > Ok, fair enough.  If that's the case, perhaps we should gently propose
> > fixes to Simon?  He's quite responsive.
> 
> If imposing a local DNS cache, please use Unbound or Bind, as those

Hah :)  The reason I ripped out the DNS local caching code before was
because of more than a few (unfounded) complaints that people didn't
want to run bind on their desktop machine.  Thus a more lightweight
solution like dnsmasq was desirable.

But in any case, if bind were to grow a usable dbus interface (while the
one it had before was OK, the bind D-Bus code itself was *horrible*)
then we could certainly add support for it too.

> are currently the only ones supporting DNSSEC. I hope we can enable
> one of those with DNSSEC per default on every fedora install soon, but
> that will take some convincing I think and won't happen overnight. But
> DNSSEC is another good reason why every host should run its own
> (validating) caching resolver.

DNSSEC is a good point though.  Perhaps we "prefer" local caching
nameservers that can do DNSSEC before falling back to those that can't?

Dan


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-07 Thread Paul Wouters

On Fri, 7 Aug 2009, Dan Williams wrote:


The most common local caching nameserver is currently dnsmasq, and it
also provides a D-Bus interface.  If at all possible, we should try to
use *one* dbus interface.  Not sure if you've looked at the dnsmasq dbus
API, but it might be worth a glance.


I did look at it. It is the worst D-Bus API I have seen in a long time
and not helpful. Someone would have to fix it first. The amount of
parameter overloading it does is just insane. Otherwise dnsmasq has a
pretty nice set of features.


Ok, fair enough.  If that's the case, perhaps we should gently propose
fixes to Simon?  He's quite responsive.


If imposing a local DNS cache, please use Unbound or Bind, as those
are currently the only ones supporting DNSSEC. I hope we can enable
one of those with DNSSEC per default on every fedora install soon, but
that will take some convincing I think and won't happen overnight. But
DNSSEC is another good reason why every host should run its own
(validating) caching resolver.

Paul
___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-07 Thread Dan Williams
On Thu, 2009-08-06 at 12:04 -0700, Marcel Holtmann wrote:
> Hi Dan,
> 
> > > I'm one of the developers on Chromium[1] (aka Google Chrome) for
> > > Linux. Chromium likes to prefetch DNS records a lot and, as such, we
> > > would very much like it if Linux systems came with a local DNS cache.
> > > 
> > > To that end, I'm hacking up DJB's public domain DNS cache[2] to build
> > > with autotools, have a DBus interface etc[3], in the hope that it can
> > > turn into a painless package install and, in time, become standard
> > > practice.
> > 
> > These days I'd rather just use a local caching nameserver by default in
> > NM, and let those that don't want it turn it off or something.
> > 
> > The most common local caching nameserver is currently dnsmasq, and it
> > also provides a D-Bus interface.  If at all possible, we should try to
> > use *one* dbus interface.  Not sure if you've looked at the dnsmasq dbus
> > API, but it might be worth a glance.
> 
> I did look at it. It is the worst D-Bus API I have seen in a long time
> and not helpful. Someone would have to fix it first. The amount of
> parameter overloading it does is just insane. Otherwise dnsmasq has a
> pretty nice set of features.

Ok, fair enough.  If that's the case, perhaps we should gently propose
fixes to Simon?  He's quite responsive.

Dan


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-06 Thread Marcel Holtmann
Hi Dan,

> > I'm one of the developers on Chromium[1] (aka Google Chrome) for
> > Linux. Chromium likes to prefetch DNS records a lot and, as such, we
> > would very much like it if Linux systems came with a local DNS cache.
> > 
> > To that end, I'm hacking up DJB's public domain DNS cache[2] to build
> > with autotools, have a DBus interface etc[3], in the hope that it can
> > turn into a painless package install and, in time, become standard
> > practice.
> 
> These days I'd rather just use a local caching nameserver by default in
> NM, and let those that don't want it turn it off or something.
> 
> The most common local caching nameserver is currently dnsmasq, and it
> also provides a D-Bus interface.  If at all possible, we should try to
> use *one* dbus interface.  Not sure if you've looked at the dnsmasq dbus
> API, but it might be worth a glance.

I did look at it. It is the worst D-Bus API I have seen in a long time
and not helpful. Someone would have to fix it first. The amount of
parameter overloading it does is just insane. Otherwise dnsmasq has a
pretty nice set of features.

Regards

Marcel


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Working with a local DNS cache

2009-08-06 Thread Dan Williams
On Wed, 2009-08-05 at 20:27 -0700, Adam Langley wrote:
> Hi,
> 
> I'm one of the developers on Chromium[1] (aka Google Chrome) for
> Linux. Chromium likes to prefetch DNS records a lot and, as such, we
> would very much like it if Linux systems came with a local DNS cache.
> 
> To that end, I'm hacking up DJB's public domain DNS cache[2] to build
> with autotools, have a DBus interface etc[3], in the hope that it can
> turn into a painless package install and, in time, become standard
> practice.

These days I'd rather just use a local caching nameserver by default in
NM, and let those that don't want it turn it off or something.

The most common local caching nameserver is currently dnsmasq, and it
also provides a D-Bus interface.  If at all possible, we should try to
use *one* dbus interface.  Not sure if you've looked at the dnsmasq dbus
API, but it might be worth a glance.

That said, if we really can't agree on a common D-Bus interface, we can
certainly wrap stuff in NetworkManager.  There's a few considerations
however:

1) if each daemon implements a different dbus interface, how do we
determine what daemon NM sends zones to?  All of them?  Priority list?
Command-line switch (ugh) ?

2) We need to do "split DNS", ie for all zones "*.foo.com" query this
set of nameservers, but for all other zones, query a different set.
This was originally what we wanted to use a local caching nameserver for
in NM.

> An important part of this would be to have NetworkManager configure
> the DNS cache when it gets new resolver information. I did a 10 minute
> hack[4] and it would be great if someone could let me know if I'm
> heading in the wrong direction at this stage. The part which mostly
> gives me pause for thought is that I'm making a DBus RPC call in
> named-manager, and I don't know if that's verboten because of latency
> considerations.

Yeah, that's more or less what gets done.  The less-hacking approach
would be:

1) Make SetServersForDomain() actually take a domain so we can do split
DNS.  That's actually a deal-breaker (see above)...  Obviously the
default domain would be something like "" (zero-length string) or "*".

2) Should be making an async D-Bus call here so that NM doesn't block.
This would take a bit of re-architecting inside NM but it's not
impossible; IP config information is updated in a few places but it
looks like a bit of work could make it happen async.

3) Potentially multiple caching nameserver implementations; dnsmasq has
been around for ages and has provided a dbus interface for a few years,
we just never got around to making NM talk to it.  bind had a dbus
interface a long time back, but people really objected to running bind
on a desktop for some reason, so we dropped that.  In any case, whatever
we pick has to be able to handle different D-Bus APIs, probably through
use of a GInterface to abstract them to the namedmanager, and then small
implementations for each caching nameserver implementation that
implement the GInterface.

All in all, not too hard, and definitely something that's been wanted
for a while!

Dan


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list