From e5bf3b99d39bac5390bd780b08585f2897caf86d Mon Sep 17 00:00:00 2001 From: doc Date: Sun, 29 Jun 2025 07:20:14 +0000 Subject: initial commit --- bootstrap-unbound.sh | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++ convert.sh | 62 +++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100755 bootstrap-unbound.sh create mode 100755 convert.sh diff --git a/bootstrap-unbound.sh b/bootstrap-unbound.sh new file mode 100755 index 0000000..bed5ff1 --- /dev/null +++ b/bootstrap-unbound.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash +# bootstrap-unbound.sh +# One-shot installer / hardener for an Unbound recursive resolver +# Tested on Debian 11+/Ubuntu 22.04+ (systemd-based) + +set -euo pipefail +IFS=$'\n\t' + +######################### 1. Settings ################################ + +# Where you’ll listen for queries (adjust subnet as needed!) +LISTEN_SUBNET="192.168.0.0/16" +THREADS="$(nproc)" +ROOT_HINTS="/var/lib/unbound/root.hints" +UNBOUND_CONF="/etc/unbound/unbound.conf" + +######################### 2. Install ################################# + +echo "πŸ“¦ Installing Unbound..." +apt-get update -qq +DEBIAN_FRONTEND=noninteractive apt-get install -y unbound curl jq dnsutils + +######################### 3. Root hints ############################## + +echo "🌍 Fetching ICANN root hints..." +curl -sSL https://www.internic.net/domain/named.root -o "$ROOT_HINTS" + +######################### 4. Config file ############################# + +echo "πŸ›  Writing $UNBOUND_CONF ..." +cat > "$UNBOUND_CONF" </etc/unbound/unbound.conf <