Giter Club home page Giter Club logo

dns-lots-of-lookups's Introduction

DNS Lots-of-Lookups (DNSLOL)

Build Status Coverage Status Go Report Card GolangCI

DNS Lots-of-Lookups (DNSLOL) is a small command line utility suitable for doing large-scale DNS lookups quickly. In particular DNSLOL is tailored towards doing comparative analysis of the results of doing these lookups with different DNS servers.

Install

DNSLOL is packaged as a Go module, allowing you to clone the source outside of your $GOPATH and install using the vendored dependencies.

  1. Set up Go 1.11+ and your $GOPATH
  2. git clone github.com/letsencrypt/dns-lots-of-lookups
  3. cd dns-lots-of-lookups
  4. go -mod=vendor install ./...

Usage

  1. Increase the ulimit for the number of open files for your session to match your desired -parallel setting. E.g. for a -parallel of 4000 run:
   ulimit nofile 4000
  1. Start the lookup process. In this example we configure dnslol to perform A and TXT queries for every domain in input_domains.txt, using two local recursive resolvers (one on port 1053, and one on 1054). It will gradually spawn new goroutines every 15s, up to a maximum of 4000 goroutines. Prometheus metrics will be exported on the metrics address, http://127.0.0.1:6363/metrics.
   dnslol \
    -checkA \
    -checkTXT \
    -servers 127.0.0.1:1053,127.0.0.1:1054 \
    -parallel 4000 \
    -spawnInterval 15s \
    -metricsAddr 127.0.0.1:6363 \
    < input_domains.txt

Input

dnslol expects to read fully qualified domain names as input to standard in. All of the domain names must be in ASCII form. Internationalized Domain Names (IDN) must be converted to ASCII before using dnslol according to the IDNA2008 encoding method. You may find using this small Go tool helpful for converting IDN domains to ASCII:

   cat raw_input_domains.txt | go run idna-encode.go > input_domains.txt

dnslol can read input domains in label-wise reversed form if you provide the -reverse label. This will automatically convert inputs like org.letsencrypt.www to www.letsencrypt.org.

Database

DNSLOL will write results to a MariaDB database. If you don't have one of these handy, a docker-compose.yml file is provided that can quickly create a MariaDB container for dnslol to use.

If you do have an existing DB handy you will need to change the -db flag provided to dnslol and ensure the database has been initialized with the SQL found in db-schema.sql

Otherwise, before trying to use the docker compose file make sure you have Docker Engine 1.10.0+ and Docker Compose 1.6.0+ installed. If you do not, you can follow Docker's installation instructions.

You can start the database by running:

    docker-compose up

This will start a dnslotsoflookups_db_1 container running MariaDB. A dnslol database user will be created with the password dnslol. This user will be granted superuser privileges for the dnslol-results database. The database will be listening on the private IP 10.10.10.2 on port 3306.

You will need to create the initial database structure the first time you start the database container using the mysql command line tool (You may need to install this command on your host machine separately if you don't already have it):

    mysql \
      -u dnslol \
      -pdnslol \
      -P 3306 \
      -h 10.10.10.2 \
      --protocol=tcp \
      dnslol-results < db-schema.sql

You can view the database logs by running:

    docker-compose logs db

Important - By default the dnslol user has a hardcoded password equal to the username. Never use the dnslol DB container in a production setting!

Metrics

DNSLOL exports several Prometheus metrics on the configured -debugAddr that can be used to monitor the performance and results of a dnslol run.

Metric Name Metric Type Labels Description
lookup_results Counter Vec server, result Result count per query rcode or error result
attempts Counter server Number of lookup attempts made
successes Counter server Number of lookup successes
queryTime SummaryVec server, type Query duration (seconds) per type
commandLine GaugeVec server, line Command line invocation of the dnslol tool

dns-lots-of-lookups's People

Contributors

adamdecaf avatar cpu avatar jsha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dns-lots-of-lookups's Issues

Break coordination between servers

Right now, submission to all servers is done in serial and blocking, which creates the potential for one server's performance to influence the query rate received by the other server. This can create misleading results, like one server running out of memory when the other doesn't.

Instead, each query should randomize the order of servers, fire off the requests to each server on independent goroutines, and then block on a waitgroup to merge the goroutines.

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.