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

    After restart, Unbound DNS Resolver don't work

    Scheduled Pinned Locked Moved DHCP and DNS
    13 Posts 5 Posters 3.5k Views 6 Watching
    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.
    • UnoptanioU Offline
      Unoptanio
      last edited by Unoptanio

      Hello,

      pfSensePlus ver 24.11

      I've had a problem for a while and haven't been able to resolve it.

      After starting pfsense, the DNS resolver doesn't work, and I can't browse. Unbound DNS Resolver

      All the services are running apparently without errors.

      If I manually stop the DNS Resolver service and restart it, everything works normally again.

      This situation is quite annoying because, despite the UPS, sometimes there's a power outage for too long, and when it comes back, the DNS resolver doesn't work when the system reboots.

      Do you have any ideas on how to fix this? Could I perhaps delay the service's startup?

      131dfd6a-e0be-4f03-b27f-acd4c0cb2069-image.png

      f05214ce-7cc1-4b7b-bb75-13316d89d30a-image.png

      81716d13-bd47-483f-a19f-2d93dbe74ee2-image.png

      0c1852cc-bde8-4b85-a755-e1ba4761c7c2-image.png

      e06580fa-2211-4a89-a142-b958af9d5db5-image.png

      71f85cbf-3a6b-41a2-b482-0b47821b4256-image.png

      pfSensePlus24.11 2U BareMetal Asrock Industrial IMB-X1314MicroATX
      CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
      n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

      GertjanG 1 Reply Last reply Reply Quote 0
      • GertjanG Offline
        Gertjan @Unoptanio
        last edited by Gertjan

        @Unoptanio said in After restart, Unbound DNS Resolver don't work:

        Do you have any ideas on how to fix this?

        Look at the the system and resolver logs, note down the last entries (timestamp).

        Now, restart the system.

        Get back to the logs and list every line added since.

        I'm pretty sure unbound did start, but it failed ? Or do you really saw a 'stop' without a subsequent 'start' ?

        Can you use these two default settings ?

        933ab7f5-2134-4699-b059-404780c9e462-image.png

        You are forwarding to who ?
        No issues reaching these remote revolvers ?

        edit : I has no issues with 24.11, and can tell you now, after month of usage : 25.07.1 is also ok.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        UnoptanioU 1 Reply Last reply Reply Quote 0
        • UnoptanioU Offline
          Unoptanio @Gertjan
          last edited by Unoptanio

          @Gertjan

          f815a923-ccf4-4106-b4d9-cd2335a1c088-image.png

          cd036410-f29c-411d-919b-2ab193a54d79-image.png

          pfSensePlus24.11 2U BareMetal Asrock Industrial IMB-X1314MicroATX
          CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
          n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

          GertjanG 1 Reply Last reply Reply Quote 0
          • UnoptanioU Unoptanio referenced this topic
          • GertjanG Offline
            Gertjan @Unoptanio
            last edited by Gertjan

            @Unoptanio

            This looks nice, but doesn't 'show' what needs to be seen.
            The command is good, though.
            So, use pfSense best interface : ssh or the console (menu option 8) :

            grep -E 'start|stop' /var/log/resolver.log
            

            This will only show when is stopped and started.
            Not if there was an error logged that could explain the 'why it stopped'.

            So,

            ee /var/log/resolver.log
            

            and have a look ^^

            Try this one :

            tail -f /var/log/resolver.log
            

            edit : When you say "Unbound DNS Resolver don't work" :
            Check this first :

            [25.07.1-RELEASE][root@pfSense.bhf.tld]/root: ps aux | grep 'unbound'
            ....
            unbound 99926   0.0  3.8 176100 156044  -  Ss   03:53       5:15.43 /usr/local/sbin/unbound -c /var/unbound/unbound.conf
            ...
            

            so I know it runs.

            [25.07.1-RELEASE][root@pfSense.bhf.tld]/root: sockstat | grep 'unbound'
            unbound  unbound    99926 3   udp6   *:53                  *:*
            unbound  unbound    99926 4   tcp6   *:53                  *:*
            unbound  unbound    99926 5   udp4   *:53                  *:*
            unbound  unbound    99926 6   tcp4   *:53                  *:*
            unbound  unbound    99926 7   tcp6   *:853                 *:*
            unbound  unbound    99926 8   tcp4   *:853                 *:*
            unbound  unbound    99926 10  tcp4   127.0.0.1:953         *:*
            ....
            

            This tells me on what interfaces (== "all") and which ports is listens = TCP & UDP, port 53 and and 853 and 953.

            Let's talk to it 'localhost' or '127.0.0.1' is included in the "All Interfaces" :

            [25.07.1-RELEASE][root@pfSense.bhf.tld]/root: dig @127.0.0.1 goofle.com +short
            162.210.199.65
            

            Again, but this time using my LAN interface (which is the default 192.168.1.1/24 - yours might be diffrent ) :

            [25.07.1-RELEASE][root@pfSense.bhf.tld]/root: dig @192.168.1.1 goofle.com +short
            162.210.199.65
            

            Now, visit a LAN device like a Windows PC :
            Command line, of course, and :

            [25.07.1-RELEASE][root@pfSense.brit-hotel-fumel.net]/root: dig @192.168.1.1 goofle.com +short
            162.210.199.65

            PS C:\Users\Gauche> nslookup gogol.com
            Serveur :   pfSense.bhf.tld
            Address:  2a01:cb19:abcd:a7e2:92ec:77ff:fe29:392c
            
            Réponse ne faisant pas autorité :
            Nom :    gogol.com
            Address:  34.117.176.22
            

            This tells me that my PC uses 192.168.1.1/24 (actually the IPv6 counterpart) as a DNS source.
            It tells me the host name of my pfSense, so I know my PC can reach the pfSense DNS the resolver.
            It also manged to tell me that gogol.com exists (!!?!) and that is has an IPv4.

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 1
            • L Offline
              Luca De Andreis
              last edited by

              I can confirm, I'm having the same problem (PfSense 25.07.1)

              Initially, I thought it only occurred after an irregular shutdown.
              This evening, I performed an HALT on PfSense, then restarted it.

              The daemon was green, but DNS didn't work.

              Restart DNS... all good.

              GertjanG 1 Reply Last reply Reply Quote 0
              • GertjanG Offline
                Gertjan @Luca De Andreis
                last edited by

                @Luca-De-Andreis said in After restart, Unbound DNS Resolver don't work:

                but DNS didn't work.

                can't say much about that.
                Can you detail ? See tests above.

                No "help me" PM's please. Use the forum, the community will thank you.
                Edit : and where are the logs ??

                UnoptanioU 2 Replies Last reply Reply Quote 0
                • UnoptanioU Offline
                  Unoptanio @Gertjan
                  last edited by

                  @Gertjan
                  As soon as I can I'll do the tests and update you.

                  pfSensePlus24.11 2U BareMetal Asrock Industrial IMB-X1314MicroATX
                  CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
                  n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

                  1 Reply Last reply Reply Quote 0
                  • UnoptanioU Offline
                    Unoptanio @Gertjan
                    last edited by Unoptanio

                    @Gertjan

                    Hello,

                    i have change this config with ALLL and ALL:

                    2b2a874b-f9be-430d-b770-9ab51546f2e3-image.png

                    Before i have this configuration:
                    I had read somewhere that under "Outgoing Network Interfaces" only WAN should be selected, and under "Network Interfaces" everything should be selected EXCEPT the WAN.

                    Then, after trying various things, I also added "LAN_SEDE" to the "Outgoing" section. But the problem persisted. In addition to the WAN I had added the "LAN SEDE" where pfsense is connected

                    4764e380-c540-4056-bd35-b899ab794ad7-image.png

                    Than:
                    Today 14 September 2025 at 08:32 i have restart pfsense.

                    after reboot this time everything seems to work

                    f65a1bbb-0fae-4e68-8629-795d479df382-image.png

                    I just did another reboot and it's working fine

                    It seems that the problem occurs when selecting items inside "network interface" or inside "outgoing network interfaces"

                    9f628aed-9a15-4bc5-8067-4ed649c537ae-image.png

                    pfSensePlus24.11 2U BareMetal Asrock Industrial IMB-X1314MicroATX
                    CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
                    n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

                    L 1 Reply Last reply Reply Quote 0
                    • L Offline
                      Luca De Andreis @Unoptanio
                      last edited by

                      @Unoptanio

                      I can confirm that my configuration does not have a default setting either.
                      The interfaces are not configured in ALL:ALL mode and the problem occurs.

                      UnoptanioU 1 Reply Last reply Reply Quote 0
                      • UnoptanioU Offline
                        Unoptanio @Luca De Andreis
                        last edited by Unoptanio

                        @Luca-De-Andreis
                        Have you tried setting ALL, ALL?

                        I only did restarts and not system shutdowns.

                        pfSensePlus24.11 2U BareMetal Asrock Industrial IMB-X1314MicroATX
                        CPU: i7-13700@5.2GHz, RAM:32GB ECC, n°2 Samsung 870EVO SATA 2.5” SSD 1TB (ZFS) Raid1
                        n°3 Intel i225-LM 2500/1000/100Mbps, n°1 NIC Intel i350-T4V2 10/100/1000 Mbps 4*GLAN, n°1 Intel X520-DA2

                        L 1 Reply Last reply Reply Quote 0
                        • L Offline
                          Luca De Andreis @Unoptanio
                          last edited by

                          @Unoptanio

                          Yes, its true.
                          Setting ALL:ALL the DNS works correctly from system restart without manually restart daemon (after reboot) !
                          I've just tried now.

                          D C 2 Replies Last reply Reply Quote 1
                          • D Offline
                            DBMandrake @Luca De Andreis
                            last edited by DBMandrake

                            @Luca-De-Andreis said in After restart, Unbound DNS Resolver don't work:

                            @Unoptanio

                            Yes, its true.
                            Setting ALL:ALL the DNS works correctly from system restart without manually restart daemon (after reboot) !
                            I've just tried now.

                            This is a known issue which I reported a couple of years ago now. (Forum thread and also opened a redmine ticket that was not resolved)

                            It's to do with boot time sequencing of interfaces being brought up and services starting. Basically there are some race conditions in the boot up scripts that would need a significant redesign of the boot sequencing to fix properly...not an easy task on FreeBSD that lacks any kind of dependency based service scheduler and sequencer like systemd on Linux.

                            It can also happen if you have interfaces dynamically going up and down for example due to gateway groups.

                            The TL;DR is choose "All" for network interfaces for Unbound (DNS resolver) to cause it to bind to listen on all interfaces (even interfaces that don't exist yet when unbound starts) and instead use firewall rules to control access to the DNS server from networks/VLAN's that should not have access. (Put explicit block rules to port 53 on interfaces that you previously did not have bound)

                            1 Reply Last reply Reply Quote 2
                            • C Offline
                              colinstu @Luca De Andreis
                              last edited by

                              @Luca-De-Andreis said in After restart, Unbound DNS Resolver don't work:

                              @Unoptanio

                              Yes, its true.
                              Setting ALL:ALL the DNS works correctly from system restart without manually restart daemon (after reboot) !
                              I've just tried now.

                              Wow, just tried this too and after years of dealing with it - it's fixed. Thank you!

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