Backup files REP (Notabug-20.02.2023 | 14:54).

main
Nick_Kramer 2023-02-20 07:55:04 -04:00
commit 326eb4ceda
3 changed files with 137 additions and 0 deletions

29
ListDNS.db 100644
View File

@ -0,0 +1,29 @@
[*] : dnscrypt.ca-1-doh
[*] : wevpn-useast
[*] : dct-at1
[*] : ibksturm
[*] : altername
[*] : scaleway-ams
[*] : jp.tiar.app
[*] : dnscrypt.ca-1
[>] : dns.digitale-gesellschaft.ch-2
[*] : dnscrypt.ca-2-doh
[*] : dnscrypt.be
[*] : dnscrypt.uk-ipv4
[*] : doh-crypto-sx
[*] : scaleway-fr
[*] : dns.sb
[*] : bortzmeyer
[*] : ams-doh-nl
[*] : meganerd
[*] : dns.digitalsize.net
[*] : dnscrypt.pl-guardian
[*] : nextdns
[*] : quad101
[*] : dns.digitale-gesellschaft.ch
[*] : doh.appliedprivacy.net
[*] : dns.watch
[*] : jp.tiarap.org
[*] : doh.ffmuc.net
[*] : v.dnscrypt.uk-ipv4
[*] : saldns02-conoha-ipv4

31
README.md 100644
View File

@ -0,0 +1,31 @@
<h1 align="center">Hi there, I`m,
<a href="https://notabug.org/Nick_Kramer" target="_blank">
Nick Kramer.
</a>
</h1>
<h3 align="center"> Porject: RandomCryptDNS </h3>
<p align="left">
*Description: Simple Bash script for randomly selecting DNSCrypt
and DoH server from your personal list.
</p>
`LICENCIA` = **GPLv3**, en la carpeta *src/* hay archivos bajo otras licencias libres.
### How does it work? ###
* Install or build dnscrypt-proxy.
* Configure dnscrypt-proxy.
* Download this repository.
* Give chmod 777 access rights. ;)
* ListDNS.db sheet, specify actual proxy server
(name can be viewed in configuration file:
/etc/dnscrypt-proxy/dnscrypt-proxy.toml) and
change symbol * to > (change not actual in
reverse order).
* After these actions you can run this script.
**IMPORTANT:**The list path must not contain spaces.
Example list of servers, file "ListDNS.db".
Information about available public servers is
taken from: https://dnscrypt.info/public-servers

77
RandomCryptDNS.sh 100755
View File

@ -0,0 +1,77 @@
#!/bin/bash
echo "Start set Random DNS server."
path="/etc/dnscrypt-proxy/dnscrypt-proxy.toml"
nameDB="ListDNS.db"
pathAct=$(pwd)
pathList="$pathAct/$nameDB"
echo "$pathList"
old="default."
new="defailt."
i=0
old_id=0
new_id=0
end_id=0
while IFS= read -r line
do
if [[ "$line" == *"[>]"* ]];
then
old_id=$i
printf "\033[94m\033[100m$old_id|$line\033[0m \n"
old=${line:6}
fi
echo "$line"
((i++))
end_id=$i
done < $pathList
for (( j=1; j <= 10; j++ ))
do
let "new_id = $RANDOM % $end_id"
if [ $new_id -eq $old_id ]
then
echo "Random id = old id DNS server."
else
break
fi
done
i=0
while IFS= read -r line
do
if [ $new_id == $i ]
then
printf "\033[92m\033[100m$i|$line\033[0m \n"
new=${line:6}
break
fi
((i++))
done < $pathList
echo "Old DNS server = $old_id:$old"
echo "New DNS server = $new_id:$new"
let "new_id += 1"
sed -i 's/[>]/*/' $pathList
sed -i ''$new_id's/[*]/>/' $pathList
sed -i 's/'$old'/'$new'/' $path
systemctl restart dnscrypt-proxy
echo "End set random DNS server Check go to URL:https://www.dnsleaktest.com/results.html"