Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add snap support for ChinaDNS #149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,33 @@ Install
./configure && make
src/chinadns -m -c chnroute.txt

* Snap / Linux

A snap is a bundle of your app and its dependencies that works without
modification across all Linux platforms (not only limited to Ubuntu).
ChinaDNS can be easily installed through the Snap Store by:

sudo snap install chinadns

Test it, open one shell to run:

sudo -i
curl 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > ~/chnroute.txt
chinadns -m -c ~/chnroute.txt -s 114.114.114.114,8.8.8.8 -p 5354 -v

open another shell to run:

dig google.com @127.0.0.1 -p 5354

You can also build and install Snap package from the source code:

sudo apt install -y build-essential squashfuse
sudo snap install --classic snapcraft
git clone https://github.com/shadowsocks/ChinaDNS.git
cd ChinaDNS
snapcraft
sudo snap install ./chinadns_master_amd64.snap --dangerous --classic

* OpenWRT

* [Download precompiled] for OpenWRT trunk and CPU: ar71xx, brcm63xx,
Expand Down
17 changes: 17 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: chinadns
version: 'master'
summary: ChinaDNS protects yourself against DNS poisoning
description: |
ChinaDNS automatically queries local DNS servers to resolve Chinese
domains and queries foreign DNS servers to resolve foreign domains.
see - https://github.com/shadowsocks/ChinaDNS
grade: stable
confinement: strict
apps:
chinadns:
command: bin/chinadns
plugs: [network, network-bind, home]
parts:
chinadns:
source: https://github.com/shadowsocks/ChinaDNS.git
plugin: autotools