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
| #Switch to root mode
sudo su
#Define freedns version
freedns_version=v2020.9.17
#Create dcompass temp folder
sudo mkdir -p /tmp/freedns
# Swich to folder just we created.
cd /tmp/freedns
#Download dcompass binary
sudo curl -fsSLO "https://github.com/tuna/freedns-go/releases/download/$freedns_version/freedns-go-linux-amd64"
sudo cp -af /tmp/freedns/freedns-go-linux-amd64 /usr/local/bin/freedns
sudo chown root:root /usr/local/bin/freedns
sudo chmod +x /usr/local/bin/freedns
sudo bash -c 'cat > /lib/systemd/system/freedns.service' << EOF
[Unit]
Description=freedns service
[Service]
ExecStart=/usr/local/bin/freedns -f 114.114.114.114:53 -c 8.8.8.8:53 -l 127.0.0.3:53
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target
EOF
#Reload systemclt daemon
sudo systemctl daemon-reload
#Delete temp directory.
sudo rm -rf /tmp/freedns
#Enable service of dcompass auto startup when system reboot
sudo systemctl enable freedns
#Restart service of freedns
sudo systemctl restart freedns
#Check dcompass status of freedns.
sudo systemctl status freedns
|