Skip to content

Conversation

@FinalDoom
Copy link

@FinalDoom FinalDoom commented Dec 2, 2024

  • Set unbound IP as comma separated list of LB IPs not just first
  • Keep first IP behavior for dnsmasq
  • Fix bug if no hosts are set in dnsmasq or unbound

Addresses #27

Demoed changes on https://onlinephp.io/c/ae9bb, and building locally. As mentioned, open to making this a setting, but I think all pfSense versions except those with the bug linked in #27 should accept a comma-separated list.

Slightly messy with implode/explode, but I didn't want to change the struct being used too much.

$dnsmasqConfig = PfSenseConfigBlock::getRootConfigBlock($this->getController()->getRegistryItem('pfSenseClient'), 'dnsmasq');
if (!isset($dnsmasqConfig->data) || !is_array($dnsmasqConfig->data)) {
$dnsmasqConfig->data = [];
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a bug here if the hosts config is empty, it returns an empty string; so fixed that here and on unbound

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant