Giter Site home page Giter Site logo

hu19891110 / dnsmasq Goto Github PK

View Code? Open in Web Editor NEW

This project forked from infinet/dnsmasq

0.0 2.0 0.0 2.88 MB

dnsmasq fork with fast ipset/server/address lookup

License: GNU General Public License v2.0

Makefile 0.68% Python 0.54% Shell 1.35% CSS 0.07% Perl 3.08% Roff 0.19% C 92.49% HTML 1.61%

dnsmasq's Introduction

DNSMASQ fork for improving --ipsets, --server, and --address performance

Dnsmasq matches domain names for --ipsets, --server, and --address options by iterates over linked list. It is good enough for general use, but slows down as the domain names to be matched grows.

Here introduce a modified dnsmasq for fast lookup ipset/server/address options. The match time is constant regardless the size of rules.

                   root
                    |
         +---------------------+
        com                   org
         |                     |
+------------------+     +-------------+
yahoo google twitter   debian       freebsd
  |      |               |             |
 www    mail          +---------+     www
                      cn jp uk us
                      |
                     ftp

The lookup steps over domain name hierarchy top-down. All labels are stored in open addressing hash tables. Sub-level labels that belong to different parent nodes are stored separately. e.g. yahoo, google, and twitter are in one hash table, while debian and freebsd are in another.

The hash table size is power of 2, two hash functions are used to compute hash bucket. For locating a particular label from hash table, two hash values are compared first, only if they are match, should the more expensive string comparison be used to confirm the search.

Precompiled OpenWrt packages

For OpenWrt Chaos Calmer 15.05 on ar71xx and mt7620 platform. DNSSEC is disabled.

sha1sum
0a1a7c13714e982b2cf98b33fe16d572f3d1a58d dnsmasq-full_2.72-5_ar71xx_Chaos_Calmer_15.05.ipk
58b1b3e9447f55ae26dc6a5834cea826ae7a51c1 dnsmasq-full_2.72-5_ramips_24kec_Chaos_Calmer_15.05.ipk

md5sum
5aa14fc279f182820b8462a5f38ca0f4 dnsmasq-full_2.72-5_ar71xx_Chaos_Calmer_15.05.ipk
f4b5b8c71f05efbf1f5b98ba1abb7ed8 dnsmasq-full_2.72-5_ramips_24kec_Chaos_Calmer_15.05.ipk

Example usage

Use DNS blackhole to block malware site:

address=/example.com/

Force google DNS as upstream server for special domain:

server=/example.com/8.8.8.8

Add all IPs of a paticular domain to IPSET:

ipset=/example.com/example-ipset

dnsmasq's People

Contributors

simonkelley avatar rasky avatar infinet avatar themiron avatar thozza avatar andy-padavan avatar ldir-edb0 avatar mandree avatar rgenoud avatar yousong avatar brad0 avatar cyfdecyf avatar falconindy avatar giact avatar curvedmark avatar dedeckeh avatar zx2c4 avatar nerdling avatar jglick avatar kanjimonster avatar karlvogel avatar mestery avatar iamben avatar matthewjohn avatar mwarning avatar vdorst avatar aa65535 avatar rsmarples avatar danners avatar rudis avatar

Watchers

hadi 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.