NOTE: I found out these settings do not persist after a reboot. Annoying. I’ll get back to that soon for a fix.
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:
- local-unbound-setup 192.168.0.2 192.168.0.3
- 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.
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