Skip to content
/ dnstrie Public

Simple DNS-aware trie for fast matching with zone cut wildcards

License

Notifications You must be signed in to change notification settings

ynadji/dnstrie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dnstrie

A simple trie for filtering DNS names. Includes a CLI interface in the binary dfilter.

Install

$ go get -u github.com/ynadji/dnstrie

dfilter

dfilter is a simple CLI tool for filtering domain names. Given a file of of fully qualified domains and wildcarded zone cuts to match on, dfilter will take in domains on STDIN and print those that match the filter to STDOUT. Matches can be specified with a leading *, which includes the parent domain, or with a +, which only includes children. See the Example below.

Install

$ go get -u github.com/ynadji/dnstrie/dfilter

Usage

¡ dfilter -h
NAME:
   dfilter - cat domains.txt | dfilter ...

USAGE:
   dfilter [global options] command [command options] [arguments...]

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --matches value  Path to file of domain matches, one per line.
   --help, -h       show help (default: false)

Example

$ echo "eff.org
random.foo.org
notareal.domain.test
google.com
mail.google.com
mine.mail.google.com
web.google.com
foo.web.google.com" \
| dfilter --matches <(echo -e "+.org\ngoogle.com\n+.mail.google.com\n*.web.google.com")
eff.org
random.foo.org
google.com
mine.mail.google.com
web.google.com
foo.web.google.com

About

Simple DNS-aware trie for fast matching with zone cut wildcards

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages