README 1.8 KB

12345678910111213141516171819202122232425262728293031323334
  1. bulkquery - A program by Brent Bice - 02/2002
  2. Bulkquery is a multi-threaded program that makes a large number of
  3. DNS queries as fast as possible. It's tailored for making DNS queries for
  4. specific IP addresses against specific DNS based RBLs.
  5. "Why bother?"
  6. I've been asked this several times. While running squirrelmail on a server
  7. with very little bandwidth and very high latency (a dial-up account - snicker)
  8. I noticed that while my filters plugin was making gethostbyname() function
  9. calls, my dial-up line was mostly idle. This was, apparently, because all
  10. the DNS function calls were being made in series. Once a DNS query had been
  11. sent, no others were sent until a response had been received or until a
  12. certain timeout period had occurred. And some of the RBLs were quite a
  13. bit faster than the others. This seemed pretty inefficient. "Why not make
  14. more DNS queries while waiting for the replies," I thought.
  15. After several attempts to make a multi-threaded program to make the queries
  16. using the standard DNS library calls, I realized why. The library functions
  17. weren't thread-safe and most of the replies would be lost. Luckily, a
  18. friend of a friend told me about the lwres API in Bind 9.x and told me that
  19. IT was definitely thread-safe and very fast.
  20. Boy was SHE right!
  21. So, how much faster is it? It will depend on your bandwidth and the
  22. latency of your connection. But for those of us trying to make do with less,
  23. bulkquery is a LOT faster. On a dial-up connection, I can make queries
  24. anywhere from 6 to 10 times faster! On my T1 at work, the queries are
  25. usually between 2 and 7 times faster. The bottom line of all of this is
  26. that even on my T1 at work, the filters plugin can query ALL of the RBLs
  27. for all the new email in my INBOX in less than half the time it takes using
  28. the PHP gethostbyname() function calls.