GithubHelp home page GithubHelp logo

sumonst21 / dnsblast Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jedisct1/dnsblast

0.0 2.0 0.0 19 KB

A simple and stupid load testing tool for DNS resolvers

License: ISC License

C 95.99% Makefile 4.01%

dnsblast's Introduction

DNSBlast

dnsblast is a simple and really stupid load testing tool for DNS resolvers.

Give it the IP address of a resolver, the total number of queries you want to send, the rate (number of packets per second), and dnsblast will tell you how well the resolver is able to keep up.

What it is:

  • a tool to spot bugs in DNS resolvers.
  • a tool to help you tune and tweak DNS resolver code in order to improve it in some way.
  • a tool to help you tune and tweak the operating system so that it can properly cope with a slew of UDP packets.
  • a tool to test a resolver with real queries sent to the real and scary interwebz, not to a sandbox.

What it is not:

  • a tool for DoS'ing resolvers. There are way more efficient ways to achieve this.
  • a benchmarking tool.
  • a tool for testing anything but how the server behaves under load. If you need a serious test suite, take a look at what Unbound provides.

What it does:

It sends queries for names like <random char><random char><random char><random char>.com.

Yes, that's 4 random characters dot com. Doing that achieves a NXDOMAIN vs "oh cool, we got a reply" ratio that is surprisingly close to the one you get from real queries made by real users.

Oh, and it displays that:

Sent: [1000] - Received: [799] - Reply rate: [250 pps] - Ratio: [79.90%]

That's the number of packets that have been sent, how many have been received (if everything is fine, both values should be the same), how fast the server replies, and the ratio between received and sent queries.

Different query types are sent. Namely SOA, A, AAAA, MX and TXT, and the probability that a query type gets picked is also close to its probability in the real world.

Names are occasionally repeated, also to get closer to what happens in the real world. That triggers resolver code responsible for queuing and merging queries.

The test is deterministic: the exact same sequence of packets is sent every time you fire up dnsblast. The magic resides in the power of the rand() function with a fixed seed.

What it does not:

It doesn't support DNSSEC, it doesn't send anything using TCP, it doesn't pay attention to the content the resolver sents.

Fuzzing:

In addition, dnsblast can send malformed queries.

Most resolvers just ignore these, so don't expect a high replies/queries ratio. But this feature can also help spotting bugs.

The fuzzer is really, really, really simple, though. It just changes some random bytes. It doesn't even pay attention to the server's behavior.

How do I compile it?

Type: make.

The code it trivial and should be fairly portable, although it only gets tested on OSX and OpenBSD.

How do I use it?

To send a shitload of queries to 127.0.0.1:

dnsblast 127.0.0.1

To send 50,000 queries to 127.0.0.1:

dnsblast 127.0.0.1 50000

To send 50,000 queries at a rate of 100 queries per second:

dnsblast 127.0.0.1 50000 100

To send 50,000 queries at a rate of 100 qps to a non standard-port, like 5353:

dnsblast 127.0.0.1 50000 100 5353

To send malformed packets, prepend "fuzz":

dnsblast fuzz 127.0.0.1
dnsblast fuzz 127.0.0.1 50000
dnsblast fuzz 127.0.0.1 50000 100
dnsblast fuzz 127.0.0.1 50000 100 5353

If you think that it desperately cries for getopt(), you're absolutely correct.

dnsblast's People

Contributors

jedisct1 avatar olof avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.