Unbound DNS: Overrides - Not appearing

Started by keropiko, May 23, 2024, 02:30:30 PM

Previous topic - Next topic
Hello,

i have opnsense latest version installed, and noticed a bug on the unbound configuration page.

I have some Host Overrides setup that work and today i tried to add an alias through "Edit Host Override Alias".

Althout i added the alias and verified it was working, in the page i see "No results found for selected host or none selected".


you have definitively ticked the host override that you want to add/modify the alias for, right ?

hi, ofcourse. Also i verified by dns lookups that the settings are working. The problem i can't see/manage/delete what i have activated  ::)

Exactly. And when iam trying to add the overwrite again, I see a duplicate error in the unbound log

August 15, 2024, 11:58:37 AM #5 Last Edit: August 15, 2024, 01:21:15 PM by vibe
Oh dear, I have also become victim to this bug after upgrading to 24.7 . However, I had five DNS host aliases already defined but now only one shows up in the GUI. All are in the config.xml and resolve OK.

I can create new entries in the GUI form but they don't show up in the GUI list of host aliases, only the first one that I defined some time ago is displayed. When I download a backup and examine the XML, all of the aliases are present including the new entries. When that backup config file is used in a restore, the new hostname aliases are active but they still fail to show up in the GUI.

I had a look for the relevant code and found this:

https://github.com/opnsense/core/blob/master/src/opnsense/mvc/app/views/OPNsense/Unbound/overrides.volt

I think it is 'Bootstrap' code but I am no Javascript expert and the author didn't think it was necessary to add dependency info in a comment. I don't think it is Bootstrap 5 as 'overrides.volt' appears to use jquery. Bootstrap 5 is vanilla Javascript without jquery.

TIP: It does help others that are not familiar with your code to state in the comment header the library dependencies even if that is just a reference to a README where all the info needed to get someone up to speed when debugging can be found. All the relevant info may be obvious to the author but leaving it out is just another obstacle to discourage someone else taking a look at the code to fix it.

Line 255 of overrides.volt says that the table ID is 'grid-aliases'. There should be some Javascript code to populate the area of the table between the tbody tags on line 266-267. I couldn't find the methods for grid-alias-wrapper so I gave up.

Sadly, debugging this is beyond me. My workaround is to empty the Unbound config on OPNsense and run a separate resolver in a jail on another FreeBSD host configured using a text editor. If the GUI is broken and no longer provides any advantage then it is more secure to have a known good config in something that can be maintained than in a GUI that makes it invisible.

Just to be certain that it wasn't a browser fault, I tried adding aliases using Firefox and Chromium on FreeBSD 14.0 and Firefox and Edge on Windows 10. All four had the same result.

Hopefully, someone with much better Javascript skills than me will fix this.

I did a quick test and it works as expected: the attached aliases show below when I select the respective host entry in the upper table.

If you have steps to reproduce faulty behaviour I'll take another look.


Cheers,
Franco

It works for me as well, I just tried adding, viewing and deleting an entry.
Intel N100, 4 x I226-V, 16 GByte, 256 GByte NVME, ZTE F6005

1100 down / 800 up, Bufferbloat A+

It worked for me too, until it didn't.

One thing that I have done between creating DNS hostname aliases and upgrading to 24.7 is restoring from a config backup. I don't know if that is a factor in this problem or not. I have a spare machine that I can build from scratch without using a config restore. If that works, I will do a backup and restore to see if that stops aliases from being visible.