Giter Club home page Giter Club logo

dns-stats's Introduction

This is a data collector for DNS queries intercepted by modems/routers. It has only been tested with the cable modem Thomson DWG850-4B. I don't know if it will work with other devices but there's a big chance if the device has the ability of sending events to remote syslog servers. Some tweak is needed depending on the message format from where the useful data is extracted.

Configuration

Your machine should be running some kind of syslog daemon (syslog-ng, rsyslog, etc). You'll need to create a rule to forward syslog messages from the router to <machine running dns-stats>:1514.

rsyslog example:

:hostname,isequal,"2013" @127.0.0.1:1514 
& ~

"2013" should be something like "192.168.0.1" but my router is buggy and sends the current year instead of its address. Maybe it's not your case.

  • Download the latest version of Go <http://code.google.com/p/go/downloads/list>
  • if it's your first time using Go, there are some environment details that should be clarified with some research
  • At a terminal, clone this repo and execute go build && ./dns-stats -source <router ip>:<router name>
  • Configure your router to send syslog messages to the address of your machine. Be sure that port 514 is open to your internal network.
  • Leave it running for a while
  • Execute ./dns-stats -report or go to http://<server ip>:8514/dns

If nothing happens and you only see "tick messages", double check the configuration. If OK, maybe the syslog messages sent from your router are in another format than the used by DWG850-4B and you should fork this repo and add your router definition to collector/routers, following the Router interface:

package routers

type ROUTER_NAME struct{}

func (_ ROUTER_NAME) name() string {
	return "router-name"
}

func (_ ROUTER_NAME) message() string {
	return `regular expression that must have two named captures: "origin" and "destination"`
}

func init() {
	register(ROUTER_NAME{})
}

dns-stats's People

Contributors

mendelgusmao avatar

Stargazers

 avatar  avatar

Watchers

 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.