Skip to content

Instantly share code, notes, and snippets.

@craigvantonder
Forked from f9n/unbound-cheat-sheet.md
Created November 10, 2024 18:15
Show Gist options
  • Save craigvantonder/551abe3fe2c73d0691b20874a5b8b4fb to your computer and use it in GitHub Desktop.
Save craigvantonder/551abe3fe2c73d0691b20874a5b8b4fb to your computer and use it in GitHub Desktop.
Unbound Cheat Sheet

Unbound Cheat Sheet

Installation

$ yum install -y unbound

Setup SSL keys for unbound-control

$ unbound-control-setup

Configuration File

server:
    interface 0.0.0.0
    do-ip4: yes
    do-udp: yes
    do-tcp: yes
    logfile: /var/log/unbound
    access-control: 0.0.0.0/0 allow
    
    local-zone: "trabzon." static
    local-data: "of.trabzon IN A 192.168.0.61"
    local-data: "macka.trabzon IN A 192.168.0.100"
    # ping of.trabzon
    # ping macka.trabzon

forward-zone:
    name: "."
    forward-addr: 8.8.8.8
    forward-addr: 8.8.4.4

Verify configuration

$ unbound-checkconf

Unbound Status

$ unbound-control status

List Forwards

$ unbound-control list_forwards

Lookup on Cache

$ unbound-control lookup youtube.com

Dump Cache

$ unbound-control dump_cache > dns-cache.txt

Restore Cache

$ unbound-control load_cache < dns-cache.txt

Flush Cache

$ # Flush Specific Host
$ unbound-control flush www.youtube.com
$ # Flush everything
$ unbound-control flush_zone .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment