Skip to content

Commit 95eb320

Browse files
committed
update
1 parent 7f2819f commit 95eb320

3 files changed

+53
-18
lines changed

server/blocky-add-local-prometheus.nix

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
name = "Prometheus";
3939
type = "prometheus";
4040
access = "proxy";
41-
isDefault = true;
4241
url = "http://${config.services.prometheus.listenAddress}:${toString config.services.prometheus.port}";
4342
}
4443
];

server/unbound-add-local-prometheus.nix

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{config, ...}: {
22
# prometheus default web interface http://localhost:9090
33
# grafana default web interface http://localhost:3000
4-
# grafana unbound dashboards https://github.com/ar51an/unbound-dashboard
4+
# grafana unbound dashboards https://github.com/rfmoz/grafana-dashboards/tree/master/prometheus
55
##################
66
#-=# SERVICES #=-#
77
##################
88
services = {
99
unbound = {
1010
enable = true;
11-
localControlSocketPath = "/run/unbound/unbound.ctl";
1211
settings = {
1312
server = {
1413
extended-statistics = true;
@@ -21,6 +20,7 @@
2120
enable = true;
2221
port = 9167;
2322
listenAddress = "127.0.0.1";
23+
unbound.host = "unix://${config.services.unbound.localControlSocketPath}";
2424
};
2525
scrapeConfigs = [
2626
{
@@ -42,7 +42,6 @@
4242
name = "Prometheus";
4343
type = "prometheus";
4444
access = "proxy";
45-
isDefault = true;
4645
url = "http://${config.services.prometheus.listenAddress}:${toString config.services.prometheus.port}";
4746
}
4847
];

server/unbound.nix

+51-14
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,66 @@
1818
unbound = {
1919
enable = true;
2020
enableRootTrustAnchor = true;
21+
localControlSocketPath = "/run/unbound/unbound.ctl";
2122
settings = {
2223
server = {
23-
interface = ["127.0.0.1"];
24-
port = 5353; # XXX
25-
access-control = ["127.0.0.1/32 allow"];
26-
harden-glue = true;
24+
access-control = ["127.0.0.1/8 allow"];
25+
aggressive-nsec = true;
26+
cache-max-ttl = 86400;
27+
cache-min-ttl = 360;
28+
do-not-query-localhost = true;
29+
do-ip4 = true;
30+
do-ip6 = false;
31+
do-tcp = true;
32+
do-udp = true;
33+
edns-buffer-size = 1232;
34+
harden-algo-downgrade = true;
35+
harden-below-nxdomain = true;
2736
harden-dnssec-stripped = true;
37+
harden-glue = true;
2838
harden-large-queries = true;
2939
harden-short-bufsize = true;
30-
ratelimit = 1000;
31-
use-caps-for-id = false;
32-
prefetch = true;
40+
hide-identity = true;
41+
hide-version = true;
42+
incoming-num-tcp = 50;
43+
infra-cache-slabs = 4;
44+
interface = ["127.0.0.1"];
45+
key-cache-slabs = 4;
46+
log-local-actions = true;
47+
log-queries = true;
48+
log-replies = true;
49+
log-servfail = true;
50+
logfile = "/var/lib/unbound/unbound.log";
51+
minimal-responses = true;
52+
msg-cache-size = 142768128;
53+
msg-cache-slabs = 4;
54+
num-queries-per-thread = 4096;
55+
num-threads = 4;
56+
outgoing-range = 8192;
57+
port = 5353; # XXX
58+
prefer-ip6 = false;
3359
prefetch-key = true;
60+
prefetch = true;
61+
ratelimit = 1000;
62+
rrset-cache-size = 285536256;
63+
rrset-cache-slabs = 4;
64+
rrset-roundrobin = true;
3465
serve-expired = true;
3566
so-reuseport = true;
36-
agressive-nsec = true;
37-
deny-any = true;
38-
do-not-query-localhost = true;
39-
prefer-ip6 = false;
40-
edns-buffer-size = 1232;
41-
hide-identity = true;
42-
hide-version = true;
67+
use-caps-for-id = false;
68+
use-syslog = false;
69+
verbosity = 3; # XXX
4370
};
71+
forward-zone = [
72+
{
73+
name = ".";
74+
forward-tls-upstream = true;
75+
forward-addr = [
76+
"9.9.9.9#dns.quad9.net"
77+
"149.112.112.112#dns.quad9.net"
78+
];
79+
}
80+
];
4481
};
4582
};
4683
};

0 commit comments

Comments
 (0)