mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-02 10:59:14 +01:00
Add DNS training to install-unbound.ps1
This commit is contained in:
parent
03824dda43
commit
bcb66d2445
@ -1,4 +1,5 @@
|
|||||||
Domain
|
Domain
|
||||||
|
a.root-servers.net
|
||||||
accounts.google.com
|
accounts.google.com
|
||||||
activity.windows.com
|
activity.windows.com
|
||||||
airbnb.com
|
airbnb.com
|
||||||
@ -15,6 +16,7 @@ assets.msn.com
|
|||||||
amazon.com
|
amazon.com
|
||||||
amazon.de
|
amazon.de
|
||||||
amazon.fr
|
amazon.fr
|
||||||
|
b.root-servers.net
|
||||||
banking.ing-diba.de
|
banking.ing-diba.de
|
||||||
bing.com
|
bing.com
|
||||||
bing.de
|
bing.de
|
||||||
@ -22,6 +24,7 @@ bing.fr
|
|||||||
bitbucket.org
|
bitbucket.org
|
||||||
blitzortung.org
|
blitzortung.org
|
||||||
bolt.dropbox.com
|
bolt.dropbox.com
|
||||||
|
c.root-servers.net
|
||||||
catalog.gamepass.com
|
catalog.gamepass.com
|
||||||
changelogs.ubuntu.com
|
changelogs.ubuntu.com
|
||||||
client.dropbox.com
|
client.dropbox.com
|
||||||
@ -32,6 +35,7 @@ clients3.google.com
|
|||||||
clients4.google.com
|
clients4.google.com
|
||||||
contacts.google.com
|
contacts.google.com
|
||||||
d.dropbox.com
|
d.dropbox.com
|
||||||
|
d.root-servers.net
|
||||||
dasoertliche.de
|
dasoertliche.de
|
||||||
dealer.spotify.com
|
dealer.spotify.com
|
||||||
deepl.com
|
deepl.com
|
||||||
@ -41,11 +45,13 @@ discordapp.com
|
|||||||
dhl.de
|
dhl.de
|
||||||
download.windowsupdate.com
|
download.windowsupdate.com
|
||||||
dropbox.com
|
dropbox.com
|
||||||
|
e.root-servers.net
|
||||||
earth.google.com
|
earth.google.com
|
||||||
ebay.com
|
ebay.com
|
||||||
ebay.de
|
ebay.de
|
||||||
ebay.fr
|
ebay.fr
|
||||||
ebook3000.com
|
ebook3000.com
|
||||||
|
f.root-servers.net
|
||||||
facebook.com
|
facebook.com
|
||||||
facebook.de
|
facebook.de
|
||||||
facebook.fr
|
facebook.fr
|
||||||
@ -53,6 +59,7 @@ flightradar24.com
|
|||||||
fonts.google.com
|
fonts.google.com
|
||||||
fonts.googleapis.com
|
fonts.googleapis.com
|
||||||
fonts.gstatic.com
|
fonts.gstatic.com
|
||||||
|
g.root-servers.net
|
||||||
github.com
|
github.com
|
||||||
github.map.fastly.net
|
github.map.fastly.net
|
||||||
gmail.com
|
gmail.com
|
||||||
@ -62,9 +69,11 @@ google.de
|
|||||||
google.fr
|
google.fr
|
||||||
googleapis.com
|
googleapis.com
|
||||||
gstatic.com
|
gstatic.com
|
||||||
|
h.root-servers.net
|
||||||
heise.de
|
heise.de
|
||||||
holidaycheck.de
|
holidaycheck.de
|
||||||
hornbach.de
|
hornbach.de
|
||||||
|
i.root-servers.net
|
||||||
i.ytimg.com
|
i.ytimg.com
|
||||||
IEEE.org
|
IEEE.org
|
||||||
ibm.com
|
ibm.com
|
||||||
@ -73,6 +82,9 @@ imap.googlemail.com
|
|||||||
install.robertsspaceindustries.com
|
install.robertsspaceindustries.com
|
||||||
ipfs.io
|
ipfs.io
|
||||||
ipv6.msftconnecttest.com
|
ipv6.msftconnecttest.com
|
||||||
|
j.root-servers.net
|
||||||
|
k.root-servers.net
|
||||||
|
l.root-servers.net
|
||||||
launcher2.robertsspaceindustries.com
|
launcher2.robertsspaceindustries.com
|
||||||
licensing.mp.microsoft.com
|
licensing.mp.microsoft.com
|
||||||
live.github.com
|
live.github.com
|
||||||
@ -80,6 +92,7 @@ live.thunderbird.net
|
|||||||
livepatch.canonical.com
|
livepatch.canonical.com
|
||||||
login.live.com
|
login.live.com
|
||||||
longfiles.com
|
longfiles.com
|
||||||
|
m.root-servers.net
|
||||||
mail.google.com
|
mail.google.com
|
||||||
map.blitzortung.org
|
map.blitzortung.org
|
||||||
maps.google.com
|
maps.google.com
|
||||||
@ -140,6 +153,7 @@ twitter.de
|
|||||||
ubuntu.com
|
ubuntu.com
|
||||||
update.googleapis.com
|
update.googleapis.com
|
||||||
wetter.com
|
wetter.com
|
||||||
|
windy.com
|
||||||
wired.com
|
wired.com
|
||||||
wttr.in
|
wttr.in
|
||||||
www.google.com
|
www.google.com
|
||||||
|
|
@ -16,39 +16,43 @@
|
|||||||
try {
|
try {
|
||||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||||
|
|
||||||
"⏳ Step 1/8: Updating package infos..."
|
"⏳ Step 1/9: Updating package infos..."
|
||||||
& sudo apt update -y
|
& sudo apt update -y
|
||||||
if ($lastExitCode -ne "0") { throw "'sudo apt update' failed" }
|
if ($lastExitCode -ne "0") { throw "'sudo apt update' failed" }
|
||||||
|
|
||||||
"⏳ Step 2/8: Installing Unbound package..."
|
"⏳ Step 2/9: Installing Unbound package..."
|
||||||
& sudo apt install unbound -y
|
& sudo apt install unbound -y
|
||||||
if ($lastExitCode -ne "0") { throw "'sudo apt install unbound' failed" }
|
if ($lastExitCode -ne "0") { throw "'sudo apt install unbound' failed" }
|
||||||
|
|
||||||
"⏳ Step 3/8: Setting up Unbound..."
|
"⏳ Step 3/9: Setting up Unbound..."
|
||||||
& sudo unbound-control-setup
|
& sudo unbound-control-setup
|
||||||
if ($lastExitCode -ne "0") { throw "'unbound-control-setup' failed" }
|
if ($lastExitCode -ne "0") { throw "'unbound-control-setup' failed" }
|
||||||
|
|
||||||
"⏳ Step 4/8: Updating DNSSEC Root Trust Anchors..."
|
"⏳ Step 4/9: Updating DNSSEC Root Trust Anchors..."
|
||||||
& sudo unbound-anchor
|
& sudo unbound-anchor
|
||||||
if ($lastExitCode -ne "0") { throw "'unbound-anchor' failed" }
|
if ($lastExitCode -ne "0") { throw "'unbound-anchor' failed" }
|
||||||
|
|
||||||
"⏳ Step 5/8: Checking config file..."
|
"⏳ Step 5/9: Checking config file..."
|
||||||
& unbound-checkconf "$PSScriptRoot/../Data/unbound.conf"
|
& unbound-checkconf "$PSScriptRoot/../Data/unbound.conf"
|
||||||
if ($lastExitCode -ne "0") { throw "'unbound-checkconf' failed - check the syntax" }
|
if ($lastExitCode -ne "0") { throw "'unbound-checkconf' failed - check the syntax" }
|
||||||
|
|
||||||
"⏳ Step 6/8: Copying config file to /etc/unbound/unbound.conf ..."
|
"⏳ Step 6/9: Copying config file to /etc/unbound/unbound.conf ..."
|
||||||
& sudo cp "$PSScriptRoot/../Data/unbound.conf" /etc/unbound/unbound.conf
|
& sudo cp "$PSScriptRoot/../Data/unbound.conf" /etc/unbound/unbound.conf
|
||||||
if ($lastExitCode -ne "0") { throw "'cp' failed" }
|
if ($lastExitCode -ne "0") { throw "'cp' failed" }
|
||||||
|
|
||||||
"⏳ Step 7/8: (Re-)starting Unbound..."
|
"⏳ Step 7/9: (Re-)starting Unbound..."
|
||||||
& sudo unbound-control stop
|
& sudo unbound-control stop
|
||||||
& sudo unbound-control start
|
& sudo unbound-control start
|
||||||
if ($lastExitCode -ne "0") { throw "'unbound-control start' failed" }
|
if ($lastExitCode -ne "0") { throw "'unbound-control start' failed" }
|
||||||
|
|
||||||
"⏳ Step 8/8: Checking Unbound status..."
|
"⏳ Step 8/9: Checking Unbound status..."
|
||||||
& sudo unbound-control status
|
& sudo unbound-control status
|
||||||
if ($lastExitCode -ne "0") { throw "'unbound-control status' failed" }
|
if ($lastExitCode -ne "0") { throw "'unbound-control status' failed" }
|
||||||
|
|
||||||
|
"⏳ Step 9/9: Training Unbound with frequent used domain names..."
|
||||||
|
& "$PSScriptRoot/check-dns.ps1"
|
||||||
|
if ($lastExitCode -ne "0") { throw "'unbound-control status' failed" }
|
||||||
|
|
||||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||||
"✔️ installed Unbound in $Elapsed sec"
|
"✔️ installed Unbound in $Elapsed sec"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
|
Loading…
Reference in New Issue
Block a user