1 # enable forwarding to known DNS servers
2 echo "forward-zone:\n\tname: \".\"" >> /etc/unbound/unbound.conf
3 grep ^nameserver /etc/resolv.conf | gsed 's;nameserver;\tforward-addr:;' >> /etc/unbound/unbound.conf
5 # generate key for unbound-control
8 # enable unbound-control
9 cat >> /etc/unbound/unbound.conf <<EOF
12 server-key-file: "/etc/unbound/unbound_server.key"
13 server-cert-file: "/etc/unbound/unbound_server.pem"
14 control-key-file: "/etc/unbound/unbound_control.key"
15 control-cert-file: "/etc/unbound/unbound_control.pem"
18 # enable unbound service
19 svcadm enable -s svc:/network/dns/server:unbound
21 # change resolver to localhost
22 svccfg -s svc:/network/dns/client:default setprop config/nameserver = net_address: ::1
23 svcadm refresh -s svc:/network/dns/client
24 grep ^nameserver /etc/resolv.conf
27 unbound-control status
30 unbound-control dump_cache | grep github
32 # Lookup name via Name Service switch, flush hosts first.
33 /usr/sbin/nscd -i hosts
34 /usr/bin/getent hosts github.com