https://github.com/cokebar/lede-dnsmasq-fastlookup
dnsmasq fork with fast ipset/server/address lookup
https://github.com/cokebar/lede-dnsmasq-fastlookup
dnsmasq lede
Last synced: 5 months ago
JSON representation
dnsmasq fork with fast ipset/server/address lookup
- Host: GitHub
- URL: https://github.com/cokebar/lede-dnsmasq-fastlookup
- Owner: cokebar
- License: gpl-2.0
- Created: 2017-03-06T17:09:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-08T16:09:28.000Z (over 8 years ago)
- Last Synced: 2025-04-08T20:48:07.865Z (6 months ago)
- Topics: dnsmasq, lede
- Language: Shell
- Size: 32.2 KB
- Stars: 8
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
DNSMASQ fork for improving --ipsets, --server, and --address performance
========================================================================__This is the LEDE version for https://github.com/infinet/dnsmasq/tree/fastlookup-v2.77test4__
__Dnsmasq version: 2.77test4; Tested on LEDE snapshot r3644__
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
|
ftpThe 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.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