• Stars
    star
    242
  • Rank 167,048 (Top 4 %)
  • Language
    Java
  • Created almost 12 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple unrecursive DNS server. It can easily be configured to intercept some kind of request to one address.

BlackHole

1. 简介

BlackHole是一个Java编写的DNS服务器,它可以进行DNS缓存,也支持自定义域名配置,并可以防止DNS污染。比起老牌的DNS软件pdnsd、BIND,BlackHole功能比较简单,但是更容易使用,性能也更好。

BlackHole还包含一个Web管理模块Hostd,可以让每个用户管理自己的域名配置,并且彼此之间不冲突。

2. 用途

DNS缓存

BlackHole具有DNS缓存以及持久化的功能,可以作为一个DNS缓存服务器使用,以加速DNS访问。

BlackHole缓存性能优秀,可以支持每秒50000次随机查询,平均响应时间0.3ms,高于pdnsd及BIND(测试报告)。

hosts风格自定义域名

BlackHole也支持修改域名配置,配置域名的方式非常简单,与hosts文件一致,并且支持通配符(目前仅支持A记录)。

例如:

127.0.0.1	*.codecraft.us

表示将所有以.codecraft.us形式结尾的域名全部指向127.0.0.1。

防止DNS污染

BlackHole还可以通过UDP特征判断的方式防止DNS污染攻击,对于某些无法访问的网站可以起到作用。BlackHole防止DNS的方式参见:http://code4craft.github.com/blog/2013/02/25/blackhole-anti-dns-poison/

3. 安装及配置

你使用自动脚本进行安装BlackHole:

curl http://code4craft.github.io/blackhole/install.sh | [sudo] sh

BlackHole的另一个编译后版本保存在https://github.com/code4craft/blackhole-bin,如果以上脚本对你所在环境不可用,那么可以clone这个项目到某一目录。

git clone https://github.com/code4craft/blackhole-bin.git /usr/local/blackhole

通过sudo /usr/local/blackhole/blackhole.sh start可以启动BlackHole。

Windows系统可将文件保存到任意目录,并运行start.bat(Win7下无需用管理员权限启动),若弹出终端界面并且持续运行,则启动成功。

各种问题解决、具体的设置以及技术细节请看Blackhole Server Docs

4. 协议

BlackHole的连接部分参考了EagleDNS的代码,遵守LGPLv3协议。

作者邮箱: [email protected]

Bitdeli Badge

More Repositories

1

webmagic

A scalable web crawler framework for Java.
Java
11,370
star
2

tiny-spring

A tiny IoC container refer to Spring.
Java
4,037
star
3

netty-learning

Netty learning.
Java
3,546
star
4

jsoup-learning

Jsoup学习笔记。添加了部分学习代码和注释。
Java
636
star
5

xsoup

When jsoup meets XPath.
Java
464
star
6

hello-design-pattern

Hello world using all 23 kinds of GoF design patterns.
Java
390
star
7

os-learning

一个Java码农的Linux内核学习
C
23
star
8

hostd

Tools to custom your domain resolved rules. Used BlackHole as DNS server.
JavaScript
19
star
9

lucene-learning

Lucene learning.
14
star
10

pdnsd

fork of pdnsd https://gitorious.org/pdnsd
C
14
star
11

netty-servlet

A tiny servlet container using netty.
Java
13
star
12

spring-learning

Spring源码阅读笔记,针对2.5.6
Java
12
star
13

mocksocks

A socks proxy for network monitor.
Java
12
star
14

express.java

A tiny RESTful web framework with embed server. Used as instead of JMX for cross-language communication.
Java
12
star
15

moonlink

A short url service based on OpenResty and redis.
Lua
10
star
16

jsocks

Socks server in Java. Mirror of jsocks in googlecode. Change builder from ANT to maven.
Java
10
star
17

labpages

Pages hooks for gitlab.
Ruby
8
star
18

blackhole-bin

Binary distribution backup of blackhole
Shell
7
star
19

FizzBuzzWhizz

Practice in OOP for thoughtworks quiz FizzBuzzWhizz.
Java
5
star
20

termblog

My oschina blog with jsterm.
Java
5
star
21

classic-algorithms

classic algorithms implements by Java. Just for practice.
Java
5
star
22

tavern

根据jar包进行Web项目模块化与集成的工具。
Java
5
star
23

monkeysocks

A socks proxy in Java. It can be used to record network traffics and replay them for tests.
Java
5
star
24

freemarker-learning

Freemarker 学习笔记。
Java
5
star
25

imgcrawler

imgcrawler是一个把电商网站的搜索结果抓取过来并且集中到网页展示的工具,用途?不晓得,其实这是一个培训的作业,因为实现的比较完整,就给传上来了。
5
star
26

code4craft.github.com

Life is to explore.
HTML
4
star
27

wifesays

Wifesays is a socket listener in Java program. It listens what wife says and notify all the workers!
Java
4
star
28

abc

'A'nother 'B'ean 'C'opier.
Java
4
star
29

reviewbot

gitlab防呆小工具,自动帮你修正2B代码。
JavaScript
4
star
30

soa-research

SOA环境下服务治理的研究。
3
star
31

xpathmagic

A chrome plugin to get XPath of elements.
3
star
32

groovy-learning

Practice codes in groovy
Groovy
3
star
33

tinycat

A tiny web container refer to Tomcat
3
star
34

leetcode

Solutions for https://oj.leetcode.com/
Java
3
star
35

bigdata-learning

3
star
36

forger

Dynamic Java object generator with template class and configuration.
Java
3
star
37

dp-idea

Idea plugin for dianping.
Java
3
star
38

coursera

Just coursera notes.
2
star
39

exciting

A chrome plugin to watch your new stars! Exciting!
JavaScript
2
star
40

java-facilities

Examples of java facilities. Such as JVM serializers, template engines.
Java
2
star
41

MemoriesOn

记录见识的地方,类似 http://see.sl088.com/
2
star
42

jdk-learning

Java 并发学习导论。
Java
2
star
43

daogen

Dao generator for java.
JavaScript
2
star
44

codecraft

codecraft repo
Java
2
star
45

mockmoon

A simple lua extension based on openresty. I can mock specific file to specific url.
Lua
2
star
46

ibatis-plugin

iBATIS plugin is aimed to accelerate iBATIS development in IntelliJ IDEA. Mirror of https://code.google.com/p/ibatis-plugin .
Java
2
star
47

js-learning

1
star
48

gugugua-dianconvertor

gugugua-dianconvertor is a simple tool to convert diandian backup xml file to wordpress xml file. Now only support text type file.
Groovy
1
star
49

phantomJava

A headless WebKit scriptable with a Java API.
1
star
50

dp-alfred-workflow

Alfred workflow for dianping.
1
star
51

sqlparser

A simple sqlparser.
Java
1
star
52

mocksocks-html

Web panel of mocksocks with fashional front end techs.
JavaScript
1
star
53

csapp-learning

深入理解计算机系统读书笔记
1
star
54

war4e

@deperated, see jetty-runner http://www.eclipse.org/jetty/documentation/current/jetty-runner.html
Java
1
star
55

my-tech-radar

我的新技术雷达。
1
star
56

textmagic

Textmagic is a text extractor with a powerful expression language to config.
Java
1
star
57

hessian-blacklist

Hessian2中一些无法正常序列化/反序列化的类。
Java
1
star
58

hello-ai

1
star
59

spring-practice

My spring best practice.
Java
1
star
60

imcaptcha

Captcha by image distortion.
Java
1
star