Hello dnspython users,

I'm trying to write some code to batch DNS update messages. I have
something like this:

u=dns.update.Update(zone)

for ...:
  u.add(record)
    try:
      throwaway=u.to_wire(max_size=4000)
    except dns.exception.TooBig:
      dns.query.udp(u, '127.0.0.1', port=1234)
      u=dns.update.Update(zone)

What I'm trying to do is to full up the update message to about 4k, and
then send it off to the DNS server. However, as you can imagine, the
size test (by invoking the to_wire method) is slow, and gets slower as
the update message increases in size. In fact, this method is very slow
in comparison to just injecting each update individually. It takes about
4x as long to run.

Is there a faster way to determine the size of an update message to
allow this kind of batching? Ideally I'd like to make an update message
as close to 64k as possible.

Regards,

Anand
_______________________________________________
dnspython-users mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo/dnspython-users

Reply via email to