OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • unbound - dhcpleases
« previous next »
  • Print
Pages: [1]

Author Topic: unbound - dhcpleases  (Read 6373 times)

topuli

  • Newbie
  • *
  • Posts: 14
  • Karma: 4
    • View Profile
unbound - dhcpleases
« on: May 07, 2018, 01:12:26 pm »
Hi,

i have setup dhcp and unbound.
Under System/General/Domain, a domain is set.

Unbound is enabled and "Register DHCP leases in the DNS Resolver" and "Register DHCP static mappings in the DNS Resolver" is set.

My clients do get an ip, dns-server,gateway, dns suffix... via dhcp
I can see the leased IPs under DHCPv4/Leases

However i cant resolve the hosts in my environment.
I have noticed that /var/unbound/dhcpleases.conf is empty!

What i have already tried ist:
set "System\Settings\Administration\Disable DNS Rebinding Checks"
set "Unbound DNS\General\Local Zone Type\static"

Any ideas?

Thx t.
Logged

opnfwb

  • Sr. Member
  • ****
  • Posts: 331
  • Karma: 47
    • View Profile
Re: unbound - dhcpleases
« Reply #1 on: May 09, 2018, 04:11:15 am »
Do you have Unbound configured as the local resolver? You mention that the clients are getting a dns-server with their DHCP leases, this needs to be the OPNsense box. If DHCP is configured to hand out a DNS server external to your network, the clients will use this for name resolution and will skip using the local Unbound instance for localized DNS lookups.
Logged

topuli

  • Newbie
  • *
  • Posts: 14
  • Karma: 4
    • View Profile
Re: unbound - dhcpleases
« Reply #2 on: May 12, 2018, 10:27:25 pm »
thanks for your reply. yes the dns-server the clients via DHCP is the opnsensebox.
Logged

topuli

  • Newbie
  • *
  • Posts: 14
  • Karma: 4
    • View Profile
Re: unbound - dhcpleases
« Reply #3 on: May 12, 2018, 11:13:12 pm »
today i was able to take a closer look at the problem.
after i found out about /usr/local/opnsense/scripts/dns/unbound_dhcpd.py i looked into the scipt.
unbound_control is used to list and read the local data.
So to further isolate my problem i started with:

Code: [Select]
unbound-control -c /var/unbound/unbound.conf list_loca_data I was greeted by an error message:

error: SSL handshake failed
2586055198312:error:14090086:SSL routines:ssl3_get_server_certificate:certificate verfify failed:s3_clnt.c:1269:

the reason my /var/unbound/dhcpleases.conf is empty, is because the command (unbound_control) that wants to read my local data fails.

so i asked my second best friend google and found:
https://forum.ipfire.org/viewtopic.php?t=18906

inspired by this post and after reading https://www.unbound.net/documentation/unbound-anchor.html i:

sshed into the opnsense box
Code: [Select]
cd  /var/unbound
mv root.key _root.key
mv unbound_control.key _unbound_control.key
mv unbound_control.pem _unbound_control.pem

restart unbound in the opnsense gui under System/Diagnostics/Services

unbound restarts and the files root.key, unbound_control.key and unbound_control.pem get regenerated.

Now # unbound-control -c /var/unbound/unbound.conf list_loca_data works and /var/unbound/dhcpleases.conf can be written.

i now can resolve my local dhcp-clients.

Jupidu!
Logged

opnfwb

  • Sr. Member
  • ****
  • Posts: 331
  • Karma: 47
    • View Profile
Re: unbound - dhcpleases
« Reply #4 on: May 13, 2018, 05:04:38 pm »
Nice work! Thanks for the followup response so that others can see how it was resolved. Very odd that you had to do this, though. I've never had an issue in my use cases with OPNsense and Unbound.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • unbound - dhcpleases
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2