-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall_doh_pihole.sh
More file actions
110 lines (90 loc) · 3.91 KB
/
Copy pathinstall_doh_pihole.sh
File metadata and controls
110 lines (90 loc) · 3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
#
clear
echo "
_____ _ _ _ _
| |___ ___ ___| |_ ___ _| | | |_ _ _ |_|
| --| _| -_| .'| _| -_| . | | . | | | _
|_____|_| |___|__,|_| |___|___| |___|_ | |_|
|___|
_____ _ _ _ _ _____ __ _____
| | |_ ___|_|___| |_ ___ ___| |_ ___ ___ | |__| | | __|___ ___ _ _
| --| | _| |_ -| _| . | . | | -_| _| | | | | | | | | | _| .'| | |
|_____|_|_|_| |_|___|_| |___| _|_|_|___|_| |_|_|_|_____| |_____|_| |__,|_ |
|_| |___|
| ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄|
| GREAT ENGINEERS |
| DO NOT GROW ON |
| TREES |
|_______________|
(\_❀) ||
(•ㅅ•)||
/ づ
Installs DoH (Cloudflared - But uses OpenDNS first, then Cloudflare)
Version: 0.1.0
Last Updated: 5/8/2020
https://docs.pi-hole.net/guides/dns-over-https/
"
sudo useradd -s /usr/sbin/nologin -r -M cloudflared
arch=`uname -sm`
echo "${arch}"
if [[ "${arch}" == *"armv7l"* ]]
then
echo "Installing - ARM architecture (Raspberry Pi) version of Cloudflared... \r\n "
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
tar -xvzf cloudflared-stable-linux-arm.tgz
sudo cp ./cloudflared /usr/local/bin
sudo chmod +x /usr/local/bin/cloudflared
else
echo "Installing - For Debian/Ubuntu version of Cloudflared... \r\n "
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-amd64.deb
sudo apt-get install ./cloudflared-stable-linux-amd64.deb
fi
cloudflared -v
sudo chown cloudflared:cloudflared /etc/default/cloudflared
sudo chown cloudflared:cloudflared /usr/local/bin/cloudflared
sudo mkdir /etc/cloudflared/
wget https://raw.githubusercontent.com/c2theg/srvBuilds/master/configs/cloudflared_config.yml
mv cloudflared_config.yml /etc/cloudflared/config.yml
#--- Create Service for autostart ---
wget https://raw.githubusercontent.com/c2theg/srvBuilds/master/configs/cloudflared.service
mv cloudflared.service /etc/systemd/system/cloudflared.service
sudo cloudflared service install
sudo systemctl enable cloudflared
sudo systemctl start cloudflared
sudo systemctl status cloudflared
#------------------------------------------------------------
wait
dig @127.0.0.1 -p 5053 google.com
wait
#----------------------------------------------------------------
# https://github.com/pi-hole/pi-hole/wiki/DNSCrypt-2.0
# https://github.com/DNSCrypt/dnscrypt-proxy/releases/tag/2.0.42
arch=`uname -sm`
echo "${arch}"
if [[ "${arch}" == *"armv7l"* ]]
then
echo "Downloading ARM version"
wget https://github.com/DNSCrypt/dnscrypt-proxy/releases/download/2.0.42/dnscrypt-proxy-linux_arm-2.0.42.tar.gz
tar xzvf dnscrypt-proxy-linux_arm-2.*.tar.gz
mv linux-arm dnscrypt-proxy
rm dnscrypt-proxy-linux_arm-2.*.tar.gz
else
echo "Downloading Linux version.. "
wget https://github.com/DNSCrypt/dnscrypt-proxy/releases/download/2.0.42/dnscrypt-proxy-linux_x86_64-2.0.42.tar.gz
tar xzvf dnscrypt-proxy-linux_x86_64-2.*.tar.gz
mv linux-x86_64 dnscrypt-proxy
rm dnscrypt-proxy-linux_x86_64-2.*.tar.gz
fi
cd dnscrypt-proxy
cp example-dnscrypt-proxy.toml dnscrypt-proxy.toml
sudo nano dnscrypt-proxy.toml
sudo ./dnscrypt-proxy -service install
sudo ./dnscrypt-proxy -service start
dnscrypt-proxy -version
sudo setcap cap_net_bind_service=+pe dnscrypt-proxy
#----------------------------------------------------------------
echo "DONE now you have to login to your PiHole and set the DNS server to the following:
127.0.0.1#5053
DONE!
"