Configuring unbound on FreeBSD 10.x

NOTE: I found out these settings do not persist after a reboot. Annoying. I’ll get back to that soon for a fix.

EDIT 2021-05-05: On more recent FreeBSD, say 12.2, to disable resolvconf.conf, do this, as provided by

[dvl@r720-02:~] $ cat /etc/resolvconf.conf 
resolvconf=NO
[dvl@r720-02:~] $ 

The above is documented in man 8 resolvconf.conf (search for disable).

I now return you to the original article.


Today I was setting up my new server, varm, and I noticed that my local DNS was not being used for resolving. Without that, I won’t be able to resolve any of the hosts in my home lab.

I looked at /etc/resolv.conf, the usual place for this information, but I found this message at the top of the file:

# cat /etc/resolv.conf
# Generated by resolvconf
search int.unixathome.org

nameserver 127.0.0.1
options edns0

After some work and question asking, I discovered you can achieve my goal in two ways:

  1. local-unbound-setup 192.168.0.2 192.168.0.3
  2. Add nameserver entries to /etc/resolv.conf and run local-unbound-setup

Each of those options led to the following entries in /var/unbound/forward.conf:

# This file was generated by local-unbound-setup.
# Modifications will be overwritten.
forward-zone:
	name: .
	forward-addr: 192.168.0.2
	forward-addr: 192.168.0.3

Of note, if I use option 2 above, here is what is in /etc/resolv.conf after running local-unbound-setup:

# Generated by resolvconf
search int.unixathome.org

nameserver 127.0.0.1
options edns0

# nameserver 192.168.0.2
# nameserver 192.168.0.3

With that, local host names started to resolve. Thank you EvilPete.

Example

Here’s the output from option 1:

# local-unbound-setup 192.168.0.2 192.168.0.3
/var/unbound/forward.conf created
/var/unbound/lan-zones.conf not modified
/var/unbound/control.conf not modified
original /var/unbound/unbound.conf saved as /var/unbound/unbound.conf.20150720.035316
Stopping local_unbound.
Waiting for PIDS: 567.
Starting local_unbound.
/etc/resolvconf.conf not modified
/etc/resolv.conf not modified
Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top