Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Fetch unbound config (whitelist domains) from central source

    Scheduled Pinned Locked Moved DHCP and DNS
    7 Posts 3 Posters 1.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      getut
      last edited by

      I am trying to create a system to keep multiple pfsense boxes synchronized. I have a secure server and have cron working with fetch to get the file from the central server. Cron is also issuing a restart to the unbound service after the fetch completes.

      All of that I already have working, but my problem is that the gui doesn't seem to recognize the change in the unbound.conf file and doesn't show changes custom options section where I have domains that need to be whitelisted.

      I am guessing that the pfsense gui maintains its own file that gets parsed and pushed into the unbound.conf.

      How can do this differently so that both sources are updated?

      1 Reply Last reply Reply Quote 0
      • johnpozJ Offline
        johnpoz LAYER 8 Global Moderator
        last edited by

        How are you whitelisting domains in the unbound.conf ??  Pretty familiar with unbound - there is no native whitelist/blacklist functionality ;)

        do you mean your whitelisting them for caps-id for those that do not support 0x20??
        caps-whitelist

        Or your doing something with setting some domains to transparent or local or redirect, guest you could redirect for . to something and then set different domains to like transparent or something..

        Yeah doing anything direct with conf files is normally not going to go well with pfsense, since pretty everything from a config standpoint is in the xml..  You would have to manually manipulate the xml with the info you want to be placed into some service that pfsense controls like unbound, etc.

        You might have better luck if your wanting to do stuff like this having your clients use some other dns that is easier to manipulate directly..  Whitelist/blacklist - pi-hole comes to mind as easy way to do that sort of thing.  pfblocker might be useful - not sure if it has a way to sync configs between pfsense.  But reach out to bcan, if it doesn't already have such a feature he might be up to adding such feature, etc.

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 25.07.1 | Lab VMs 2.8.1, 25.07.1

        1 Reply Last reply Reply Quote 0
        • G Offline
          getut
          last edited by

          @johnpoz:

          Or your doing something with setting some domains to transparent or local or redirect, guest you could redirect for . to something and then set different domains to like transparent or something..

          What you mention here is what I'm doing. My configs at the sites are all different enough that I have to find a solution that allows me to manage the parts that are the same across all locations centrally. This one is the best target because it is also the one that changes the most frequently.

          I've got about 25 sites so far and will be growing to 80+ sites that need this whitelist updated frequently.

          I don't mind keeping a central version of the domains that I can then massage into the xml. A central copy of the entire unbound.conf file is very easy to understand and also to edit without borking it. Not sure that will be the case with the xml.

          How would I get the system to see the changes after cron pulls in an updated xml and runs a tool to massage it in. I'm aware I would use sed in linux, but not sure I have those tools in pfsense.

          1 Reply Last reply Reply Quote 0
          • G Offline
            getut
            last edited by

            Bump any idea on the above question (previous post?)

            1 Reply Last reply Reply Quote 0
            • D Offline
              doktornotor Banned
              last edited by

              Yeah, the idea is to add XMLRPC sync to Unbound (syncing only the things you are interested in).

              1 Reply Last reply Reply Quote 0
              • G Offline
                getut
                last edited by

                I apologize if I'm a little lost. Are you saying that is what I need to use?

                Is this a tool that is already part of pfsense, or a package that I add, or a wish list item that is coming down the pipe?

                1 Reply Last reply Reply Quote 0
                • D Offline
                  doktornotor Banned
                  last edited by

                  XMLRPC yes. Unbound sync - no. Should be easy to get coded if you need it, using some of the packages as example. E.g.:

                  https://github.com/pfsense/FreeBSD-ports/blob/devel/www/pfSense-pkg-squid/files/usr/local/pkg/squid_sync.xml
                  https://github.com/pfsense/FreeBSD-ports/blob/devel/www/pfSense-pkg-squid/files/usr/local/pkg/squid.inc#L2168

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.