Add DNS training to install-unbound.ps1

This commit is contained in:
Markus Fleschutz 2022-05-29 11:27:36 +02:00
parent 03824dda43
commit bcb66d2445
2 changed files with 26 additions and 8 deletions

View File

@ -1,4 +1,5 @@
Domain
a.root-servers.net
accounts.google.com
activity.windows.com
airbnb.com
@ -15,6 +16,7 @@ assets.msn.com
amazon.com
amazon.de
amazon.fr
b.root-servers.net
banking.ing-diba.de
bing.com
bing.de
@ -22,6 +24,7 @@ bing.fr
bitbucket.org
blitzortung.org
bolt.dropbox.com
c.root-servers.net
catalog.gamepass.com
changelogs.ubuntu.com
client.dropbox.com
@ -32,6 +35,7 @@ clients3.google.com
clients4.google.com
contacts.google.com
d.dropbox.com
d.root-servers.net
dasoertliche.de
dealer.spotify.com
deepl.com
@ -41,11 +45,13 @@ discordapp.com
dhl.de
download.windowsupdate.com
dropbox.com
e.root-servers.net
earth.google.com
ebay.com
ebay.de
ebay.fr
ebook3000.com
f.root-servers.net
facebook.com
facebook.de
facebook.fr
@ -53,6 +59,7 @@ flightradar24.com
fonts.google.com
fonts.googleapis.com
fonts.gstatic.com
g.root-servers.net
github.com
github.map.fastly.net
gmail.com
@ -62,9 +69,11 @@ google.de
google.fr
googleapis.com
gstatic.com
h.root-servers.net
heise.de
holidaycheck.de
hornbach.de
i.root-servers.net
i.ytimg.com
IEEE.org
ibm.com
@ -73,6 +82,9 @@ imap.googlemail.com
install.robertsspaceindustries.com
ipfs.io
ipv6.msftconnecttest.com
j.root-servers.net
k.root-servers.net
l.root-servers.net
launcher2.robertsspaceindustries.com
licensing.mp.microsoft.com
live.github.com
@ -80,6 +92,7 @@ live.thunderbird.net
livepatch.canonical.com
login.live.com
longfiles.com
m.root-servers.net
mail.google.com
map.blitzortung.org
maps.google.com
@ -140,6 +153,7 @@ twitter.de
ubuntu.com
update.googleapis.com
wetter.com
windy.com
wired.com
wttr.in
www.google.com

1 Domain
2 a.root-servers.net
3 accounts.google.com
4 activity.windows.com
5 airbnb.com
16 amazon.com
17 amazon.de
18 amazon.fr
19 b.root-servers.net
20 banking.ing-diba.de
21 bing.com
22 bing.de
24 bitbucket.org
25 blitzortung.org
26 bolt.dropbox.com
27 c.root-servers.net
28 catalog.gamepass.com
29 changelogs.ubuntu.com
30 client.dropbox.com
35 clients4.google.com
36 contacts.google.com
37 d.dropbox.com
38 d.root-servers.net
39 dasoertliche.de
40 dealer.spotify.com
41 deepl.com
45 dhl.de
46 download.windowsupdate.com
47 dropbox.com
48 e.root-servers.net
49 earth.google.com
50 ebay.com
51 ebay.de
52 ebay.fr
53 ebook3000.com
54 f.root-servers.net
55 facebook.com
56 facebook.de
57 facebook.fr
59 fonts.google.com
60 fonts.googleapis.com
61 fonts.gstatic.com
62 g.root-servers.net
63 github.com
64 github.map.fastly.net
65 gmail.com
69 google.fr
70 googleapis.com
71 gstatic.com
72 h.root-servers.net
73 heise.de
74 holidaycheck.de
75 hornbach.de
76 i.root-servers.net
77 i.ytimg.com
78 IEEE.org
79 ibm.com
82 install.robertsspaceindustries.com
83 ipfs.io
84 ipv6.msftconnecttest.com
85 j.root-servers.net
86 k.root-servers.net
87 l.root-servers.net
88 launcher2.robertsspaceindustries.com
89 licensing.mp.microsoft.com
90 live.github.com
92 livepatch.canonical.com
93 login.live.com
94 longfiles.com
95 m.root-servers.net
96 mail.google.com
97 map.blitzortung.org
98 maps.google.com
153 ubuntu.com
154 update.googleapis.com
155 wetter.com
156 windy.com
157 wired.com
158 wttr.in
159 www.google.com

View File

@ -16,39 +16,43 @@
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
"⏳ Step 1/8: Updating package infos..."
"⏳ Step 1/9: Updating package infos..."
& sudo apt update -y
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
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
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
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"
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
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 start
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
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
"✔️ installed Unbound in $Elapsed sec"
exit 0 # success