OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 16.1 Legacy Series »
  • Unbound host entries generating bug
« previous next »
  • Print
Pages: [1]

Author Topic: Unbound host entries generating bug  (Read 3523 times)

Tikimotel

  • Newbie
  • *
  • Posts: 29
  • Karma: 6
    • View Profile
Unbound host entries generating bug
« on: March 16, 2016, 08:22:09 pm »
Currently (16.1.7) unbound does not generate the host and domain itself inside the "host_entries.conf" file.
My current work around was setting a host override.

Without it hostname lookups in windows look like so:
Code: [Select]
nslookup <enter>
Default Server:  Unkown
Address:  192.168.0.1

> Anduril
Server:  Unkown
Address:  192.168.0.1

Name:    Anduril.home
Address:  192.168.0.51

> exit

It was because the "host_entries.conf" only added localhost.
"host_entries.conf"
Code: [Select]
local-zone: "home" transparent
local-data-ptr: "127.0.0.1 localhost"
local-data: "localhost A 127.0.0.1"
local-data: "localhost.home A 127.0.0.1"
local-data-ptr: "::1 localhost"
local-data: "localhost AAAA ::1"
local-data: "localhost.home AAAA ::1"

To fix this the reference to the 'interface' needs to be changed to 'active_interface'.
Part of "unbound.inc"
Code: [Select]
519    if (isset($config['unbound']['interface'])) {
520        $interfaces = explode(",", $config['unbound']['interface']);
Code: [Select]
519    if (isset($config['unbound']['active_interface'])) {
520        $interfaces = explode(",", $config['unbound']['active_interface']);
After saving the config again the "host_entries.conf" does save for LAN interface the hostname of opnsense.
(a bit further in the code "$if" is used a variable for testing real interfaces, reading "if" and "$if" not nice...and should be changed)

Code: [Select]
local-zone: "home" transparent
local-data-ptr: "127.0.0.1 localhost"
local-data: "localhost A 127.0.0.1"
local-data: "localhost.home A 127.0.0.1"
local-data-ptr: "::1 localhost"
local-data: "localhost AAAA ::1"
local-data: "localhost.home AAAA ::1"
local-data-ptr: "192.168.0.1 OPNsense.home"
local-data: "OPNsense.home A 192.168.0.1"
local-data: "OPNsense A 192.168.0.1"

After this fix hostname lookups in windows look like so:
Code: [Select]
nslookup <enter>
Default Server:  OPNsense.home
Address:  192.168.0.1

> Anduril
Server:  OPNsense.home
Address:  192.168.0.1

Name:    Anduril.home
Address:  192.168.0.51

> exit
Logged

Tikimotel

  • Newbie
  • *
  • Posts: 29
  • Karma: 6
    • View Profile
Re: Unbound host entries generating bug
« Reply #1 on: March 16, 2016, 09:00:03 pm »
It only works for 1 interface at a time.
When selecting LAN and Localhost, the DNS Lookup page won't respond for 127.0.0.1
So when just using/choosing LAN (IPv4) it works fine.
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 13692
  • Karma: 1176
    • View Profile
Re: Unbound host entries generating bug
« Reply #2 on: March 17, 2016, 08:18:14 am »
I'm guessing that's the same issue as reported here: https://github.com/opnsense/core/issues/746#issuecomment-197067451

Not sure how to fix this for all cases yet, but that you for the analysis. That will help. :)
Logged

Tikimotel

  • Newbie
  • *
  • Posts: 29
  • Karma: 6
    • View Profile
Re: Unbound host entries generating bug
« Reply #3 on: March 17, 2016, 05:22:54 pm »
Using Localhost (which you can select in the unbound menu options) kind off, needs to be excluded.
You get double 127.0.0.1 entries, and unbound refuses to start. That's why, dns lookups are unresponsive.

I feel you can get away with just the LAN and or the LAN IPv6 Link-Local as options.
But don't know how virtual interfaces would translate, using the current "unbound.inc"
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 16.1 Legacy Series »
  • Unbound host entries generating bug
 

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