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

    Unbound seems to be restarting frequently

    Scheduled Pinned Locked Moved DHCP and DNS
    178 Posts 43 Posters 73.1k 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.
    • C
      CiscoKid85
      last edited by

      If I filter for restarts, I get the following:

      Mar 2 11:52:20	unbound: [28167:0] notice: init module 0: iterator
      Mar 2 11:52:20	unbound: [28167:0] notice: Restart of unbound 1.5.1.
      Mar 2 10:49:14	unbound: [28167:0] notice: init module 0: iterator
      Mar 2 10:49:14	unbound: [28167:0] notice: Restart of unbound 1.5.1.
      Mar 2 10:49:12	unbound: [28167:0] notice: init module 0: iterator
      Mar 2 10:49:12	unbound: [28167:0] notice: Restart of unbound 1.5.1.
      Mar 2 10:49:12	unbound: [28167:0] notice: init module 0: iterator
      Mar 2 10:09:59	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 10:09:59	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 10:03:14	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 10:03:14	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:53:20	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:53:20	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:43:24	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:43:24	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:33:30	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:33:30	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:33:30	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:33:30	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:31:00	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:31:00	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:30:56	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:30:56	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:30:20	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:30:20	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:24:02	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:24:02	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:23:29	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:23:29	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:13:34	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:13:34	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:12:04	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:12:04	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 09:09:56	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 09:09:56	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 08:09:43	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 08:09:43	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 08:02:39	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 08:02:39	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 07:52:44	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 07:52:44	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 07:49:50	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 07:49:50	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 07:42:49	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 07:42:49	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 07:40:24	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 07:40:24	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 07:38:15	unbound: [45732:0] notice: init module 0: iterator
      Mar 2 07:38:15	unbound: [45732:0] notice: Restart of unbound 1.5.1.
      Mar 2 07:37:28	unbound: [45732:0] notice: init module 0: iterator
      
      1 Reply Last reply Reply Quote 0
      • K
        kejianshi
        last edited by

        Hmmmm.  Is there a reason you don't want to use the root DNS servers (just curious)?

        1 Reply Last reply Reply Quote 0
        • C
          CiscoKid85
          last edited by

          Comcast operates a bunch of caching servers for content from Akamai, Netflix. I'd like to hit the locally cached servers when that content is requested. Netflix definitely streams a little faster, I think.

          1 Reply Last reply Reply Quote 0
          • K
            kejianshi
            last edited by

            Thing is, I think hitting the local DNS without DNSSEC and harden glue and all that might be whats crashing your unbound.

            Would you be opposed to trying it in resolver mode instead of forwarder mode for a while?  See if it stops crashing?

            1 Reply Last reply Reply Quote 0
            • C
              CiscoKid85
              last edited by

              Is there any additional logging I can enable that may offer better insight?

              Would someone mind posting their config so I can try running a good one that I know works?

              Thanks!

              1 Reply Last reply Reply Quote 0
              • C
                CiscoKid85
                last edited by

                How do I reset the Resolver general settings to their defaults? The GUI retains the settings from the previous config, even if I wipe out the .conf file.

                1 Reply Last reply Reply Quote 0
                • H
                  hda
                  last edited by

                  Why are you hard on yourself with CLI. Just use the webGUI to stop and start what you want.

                  Stop Services: DNS forwarder.
                  Clear out System: General Setup for DNS servers
                  Set Services: DNS Resolver(interfaces & DNSSEC) only
                  Services: DNS Resolver: Advanced(Harden = true)

                  Maybe reboot.

                  1 Reply Last reply Reply Quote 0
                  • C
                    CiscoKid85
                    last edited by

                    Disabling the forwarder and adding in the hardening both worked. I'll continue to troubleshoot w/ the forwards or perhaps just enable dnsmasq.

                    1 Reply Last reply Reply Quote 0
                    • C
                      CiscoKid85
                      last edited by

                      It seems adding DNS servers into the general settings tab causes the unbound restarts. This seems like a bug. Does anyone know how I would report this?

                      1 Reply Last reply Reply Quote 0
                      • K
                        kejianshi
                        last edited by

                        I don't know if its a bug or if something malicious is being done to your DNS…  Glad its working now.

                        1 Reply Last reply Reply Quote 0
                        • C
                          CiscoKid85
                          last edited by

                          Even if it's something malicious, unbound shouldn't reboot all the time. lol

                          1 Reply Last reply Reply Quote 0
                          • D
                            dparring
                            last edited by

                            I am also seeing this issue with unbound restarting frequently on a clean 2.2 install.  It is triggered by DHCPREQUEST events in dhcpd, but only when a host name is specified in the request.  For example, a request to dhcpd like this:

                            Mar 2 15:43:41 dhcpd: DHCPREQUEST for 192.168.1.208 from xx:xx:xx:xx:xx:xx (ipcam_xxxxxxxxxxxx) via em1

                            …always results in a restart of unbound at the same exact time:

                            Mar 2 15:43:41 unbound: [55204:0] info: service stopped (unbound 1.5.1).
                            (followed by a bunch of info logging and then…)
                            Mar 2 15:43:41 unbound: [55204:0] notice: Restart of unbound 1.5.1.
                            Mar 2 15:43:41 unbound: [55204:0] notice: init module 0: iterator
                            Mar 2 15:43:41 unbound: [55204:0] info: start of service (unbound 1.5.1).

                            However, a DHCPREQUEST without a host name does not trigger the restart (also this is a static mapping, the one above is from the DHCP pool):

                            Mar 2 15:47:46 dhcpd: DHCPREQUEST for 192.168.1.11 from xx:xx:xx:xx:xx:xx via em1

                            I do not have "DNS Query Forwarding" enabled in the unbound configuration.  After reading this thread, I tried disabling DNSSEC and it had no effect on the restarting behavior.  I do have "Register DHCP leases in the DNS Resolver" and "Register DHCP static mappings in the DNS Resolver" enabled which leads me to believe the problem lies in the DHCP -> DNS registration functionality.

                            I would not normally notice this behavior except that there are times where the frequent restarting of unbound sometimes seems to cause unbound to stop resolving DNS queries properly.  This usually happens when there are a lot of devices going on or offline and requesting DHCP leases.  A manual restart of unbound in the web GUI fixes it, although the restart behavior continues whenever a DHCPREQUEST with hostname is received.

                            1 Reply Last reply Reply Quote 0
                            • K
                              kejianshi
                              last edited by

                              I think people were seeing crashes when they had devices (such as cameras or laptops) that have both a wired and wireless connection and both were connected simultaneously and shouldn't have been…

                              You sure you don't have something like that going on?

                              1 Reply Last reply Reply Quote 0
                              • D
                                dparring
                                last edited by

                                It is unlikely that is the case with my installation.  Of the wireless devices I have on a wired connection, most don't even have the wireless SSID configured.  Also, my AP and all wireless devices are on a separate subnet, so anything on the 192.168.1 subnet is 100% wired.

                                1 Reply Last reply Reply Quote 0
                                • C
                                  CiscoKid85
                                  last edited by

                                  For me, the reboots stopped when I removed the DNS settings from System -> General Setup.

                                  Interestingly, I also have DNS Registration and Static DHCP enabled in resolver.. For the time being, I'm switching back to dnsmasq while I can sort it out.

                                  1 Reply Last reply Reply Quote 0
                                  • D
                                    dparring
                                    last edited by

                                    My logs (and resultant DNS problems) indicate that previously known MAC addresses and DHCP leases frequently trigger a restart, although not necessarily 100% of the time.  I found that I can reproduce the unbound restart behavior 100% of the time by bringing a machine online with a new (to the firewall) MAC and having it initiate a DHCP request.  This is on a wired machine with no wireless card.  With this, I ran a few testing scenarios:

                                    Register DHCP leases in the DNS Resolver - enabled
                                    Register DHCP static mappings in the DNS Resolver - enabled
                                    Result when DHCP is requested - unbound restart

                                    So I disabled both:

                                    Register DHCP leases in the DNS Resolver - disabled
                                    Register DHCP static mappings in the DNS Resolver - disabled
                                    Result when DHCP is requested - NO unbound restart

                                    I enabled static only:

                                    Register DHCP leases in the DNS Resolver - disabled
                                    Register DHCP static mappings in the DNS Resolver - enabled
                                    Result when DHCP is requested - NO unbound restart

                                    I went back to the original config with both enabled:

                                    Register DHCP leases in the DNS Resolver - enabled
                                    Register DHCP static mappings in the DNS Resolver - enabled
                                    Result when DHCP is requested - unbound restart

                                    This lends some weight to the theory that the restarts are related to the "Register DHCP leases in the DNS Resolver" setting.  However, one amendment to my previous post is that my testing scenario does not set a host name, yet it still triggers a restart.  This is the dhcpd log that will reliably trigger unbound to restart when Register DHCP in DNS is enabled and the MAC address is not previously known to the firewall (newest on top):

                                    Mar 2 17:40:42 dhcpd: DHCPACK on 192.168.200.212 to xx:xx:xx:xx:xx:xx via em3
                                    Mar 2 17:40:42 dhcpd: DHCPREQUEST for 192.168.200.212 (192.168.200.1) from xx:xx:xx:xx:xx:xx via em3
                                    Mar 2 17:40:42 dhcpd: DHCPOFFER on 192.168.200.212 to xx:xx:xx:xx:xx:xx via em3
                                    Mar 2 17:40:41 dhcpd: DHCPDISCOVER from xx:xx:xx:xx:xx:xx via em3

                                    1 Reply Last reply Reply Quote 0
                                    • C
                                      CiscoKid85
                                      last edited by

                                      This sounds like a bug to me.

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

                                        So your saying unbound restarts on a dhcp request… Yeah I have not seen this, but when I get home I will check.. If a bug then it would be very simple to duplicate.

                                        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 24.11 | Lab VMs 2.8, 24.11

                                        1 Reply Last reply Reply Quote 0
                                        • K
                                          kejianshi
                                          last edited by

                                          With the proper settings you can break anything.

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

                                            Well I know for sure I have both those options enabled and have not seen or atleast noticed unbound restarting.. And I would assume I would see lots of dhcp requests.  When I get home I will take a double look and force a request, etc.

                                            To be honest if this was a real bug you would think the forums would be blowing up with this happening.

                                            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 24.11 | Lab VMs 2.8, 24.11

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