Skip to content

Instantly share code, notes, and snippets.

@jaeyson
Created October 7, 2025 04:32
Show Gist options
  • Select an option

  • Save jaeyson/9e2a323a64bad8aff82f1b104799d6b7 to your computer and use it in GitHub Desktop.

Select an option

Save jaeyson/9e2a323a64bad8aff82f1b104799d6b7 to your computer and use it in GitHub Desktop.
Recursive DNS resolver called Unbound. Config location at: /etc/unbound/unbound.conf
server:
# Increase number of threads
num-threads: 4
# Enable PID file
pidfile: /var/run/unbound.pid
# Increase privacy
hide-identity: yes
hide-version: yes
use-caps-for-id: yes
# Listen on all interfaces
interface: 0.0.0.0
interface: ::0
# For now disable IPv6
do-ip6: no
# Serve stale data
serve-expired: yes
serve-expired-ttl: 86400 # one day, in seconds
serve-expired-client-timeout: 500 # 500ms
# Increase caches for better performance
msg-cache-slabs: 4
rrset-cache-slabs: 4
infra-cache-slabs: 4
key-cache-slabs: 4
rrset-cache-size: 300m
msg-cache-size: 150m
outgoing-range: 200
num-queries-per-thread: 100
# Allow access control on LAN network
access-control: 192.168.0.0/16 allow
# Enable localhost to be queried
do-not-query-localhost: no
# Add home and reverse home local zones
local-zone: "home" nodefault
domain-insecure: "home"
local-zone: "1.168.192.in-addr.arpa" transparent
domain-insecure: "1.168.192.in-addr.arpa"
# My internal DNS server
stub-zone:
name: "home."
stub-addr: 127.0.0.1@53530
# Internal Reverse DNS
stub-zone:
name: "1.168.192.in-addr.arpa."
stub-addr: 127.0.0.1@53530
# Forward the .local domain to the router
# of the names get from DHCP leases
forward-zone:
name: "local."
forward-addr: 192.168.1.1
# The following line includes additional configuration files from the
# /etc/unbound/unbound.conf.d directory.
include-toplevel: "/etc/unbound/unbound.conf.d/*.conf"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment