go-dnsblocker

command module
v0.0.0-...-f26f7d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2016 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-dnsblocker

Block dns queries in black list and proxy other queries

Black list is plain file with list of blocked domain separated with new line '\n'. File should ended with empty line.

Black list example:

google.com
facebook.com

Build

Build require installed and configured golang compiler (tested on 1.5.3).

git clone https://github.com/c0va23/go-dnsblocker.git
go build dnsblocker.go
echo google.com > hosts
sudo ./dnsblocker

Test dns request

For test you should send dns query to dnsblocker. For example use util dig:

dig @127.0.0.1 google.com

Command line arguments

-cache-duration int
    Set cache duration into seconds (default 300)
-cache-size int
    Set cache size into bytes (default 1048576)
-dns-server string
    DNS server for proxy not blocked queries (default "192.168.1.1:domain")
-hosts-path string
    Path to hosts file (default "hosts")
-listen string
    Listen is pair 'ip:port' (default ":domain")
-log-level string
    Set minimum log level (default "INFO")

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址