Hawkes Blog
Windows reboot | Linux be root
Hawkes Blog

Unbound DNS on raspberry pi

Short How-To: Unbound on raspbian

install unbound

apt-get update
apt-get install unbound
wget ftp://FTP.INTERNIC.NET/domain/named.cache -O /etc/unbound/root.hints

my /etc/unbound/unbound.conf

server:

    auto-trust-anchor-file: "/var/lib/unbound/root.key"
    #root dns list
    root-hints: "/etc/unbound/root.hints"

    #listen on all interfaces
    interface: 0.0.0.0

    #allow only local/lan access
    access-control: 127.0.0.0/8 allow
    access-control: 192.168.178.0/24 allow
    access-control: 0.0.0.0/0 refuse

    #my domain name and the available hosts
    private-domain: "home."
    include: /etc/unbound/forward.conf
    include: /etc/unbound/reverse.conf

remote-control:
    control-enable: no


#forward anything else to google dns server
forward-zone:
    name: "."
    forward-addr: 8.8.8.8
    forward-addr: 8.8.4.4
The forward lookup file (name -> ip)
/etc/unbound/forward.conf

local-zone: "home." static

local-data: "speedport.home.    IN  A   192.168.178.1"
local-data: "kasekuchen.home.   IN  A   192.168.178.21"
local-data: "raspberryone.home. IN  A   192.168.178.200"
local-data: "rbone.home.        IN  A   192.168.178.200"
local-data: "rb1.home.          IN  A   192.168.178.200"
local-data: "htpc.home.         IN  A   192.168.178.245"
local-data: "wlan.home.         IN  A   192.168.178.253"

Reverse lookup (ip -> name)
/etc/unbound/reverse.conf

local-data-ptr: "192.168.178.1    speedport.home."
local-data-ptr: "192.168.178.21   kasekuchen.home."
local-data-ptr: "192.168.178.200  raspberryone.home."
local-data-ptr: "192.168.178.200  raspberrytwo.home."
local-data-ptr: "192.168.178.245  htpc.home."
local-data-ptr: "192.168.178.253  wlan.home."

restart and testing

/etc/init.d/unbound restart
>>host wlan.home 127.0.0.1

Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:

wlan.home has address 192.168.178.253
>>host rbone.home 127.0.0.1

Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:

rbone.home has address 192.168.178.200

finally, change /etc/resolv.conf

search home
nameserver 192.168.178.200

inspired by calomel.org


comments powered by Disqus