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

    DNS Resolver Root Server Question

    Scheduled Pinned Locked Moved DHCP and DNS
    17 Posts 4 Posters 2.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.
    • GertjanG
      Gertjan @johnpoz
      last edited by Gertjan

      @jpvonhemel said in DNS Resolver Root Server Question:

      Unbound must be really special in the FreeBSD realm.

      Noop.
      I've tried Unbound using the 'other' (worlds most known) system : Debain. https://packages.debian.org/en/bullseye/unbound.
      It's the same. Does the same thing.
      It's a resolver, and because it resolves, it can do even DNSSEC.
      Unbound can forward, if you have to wire your DNS traffic to some other resolver.

      @johnpoz said in DNS Resolver Root Server Question:

      There isn't a reason..

      Have you seen [pick whatever social media] and search for : how to install pfSense ?

      You'll see this :

      84ea5415-a3ab-4659-9ee0-92f00fc2cbbe-image.png

      People tend to think they have to give something for 'Primary and Secondary here.
      The preceding text is always ( ?) overlooked :

      The default behaviour of the DNS Resolver will ignore manually configured DNS servers for client queries and query root DNS servers directly. To use the manually configured DNS servers below for client queries, visit Services > DNS Resolver and enable DNS Query Forwarding after completing the wizard

      ..... and as said, after completing the wizard, the activate forward mode.

      @johnpoz said in DNS Resolver Root Server Question:

      unbound isn't anything special - its just a resolver

      Keep in mind that that makes sense only if I know what a resolver is ๐Ÿ˜Š
      Most people are brainwashed with "I have to forward to someone / something?" because that was what we all did in the old days.

      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
      • T
        thiasaef @johnpoz
        last edited by thiasaef

        @johnpoz said in DNS Resolver Root Server Question:

        When you forward (ask google or cloudflare) what do you think happens? If they do not have it cached, it is resolved just the same way unbound does it.

        It will most likely hit the cache and even if it doesn't it is still going to be faster than my own resolver:

        Resolver (pfSense @home):

        drill forum.netgate.com
        ;; Query time: 179 msec
        

        Resolver (pfSense @vServer):

        drill forum.netgate.com
        ;; Query time: 123 msec
        

        Forward to Google (from home):

        drill forum.netgate.com @8.8.8.8
        ;; Query time: 9 msec
        

        Forward to Cloudflare (from home):

        drill forum.netgate.com @1.1.1.1
        ;; Query time: 17 msec
        

        And all of the info it gets back is cached.. So if you ask for say otherthing.something.tld - it already knows the authoritative NSers for something.tld - so it just goes and asks one of them directly since it already knows that info.. no need to ask roots or gltd servers again, etc..

        One hour later ...

        Resolver (pfSense @home):

        drill forum.netgate.com
        ;; Query time: 170 msec
        

        Resolver (pfSense @vServer):

        drill forum.netgate.com
        ;; Query time: 99 msec
        

        Forward to Cloudflare (from home):

        drill forum.netgate.com @1.1.1.1
        ;; Query time: 98 msec
        

        And the frequent Unbound restarts caused by https://redmine.pfsense.org/issues/12613 et al. result in even lower cache hit rates than ever before.

        johnpozJ GertjanG 2 Replies Last reply Reply Quote 1
        • johnpozJ
          johnpoz LAYER 8 Global Moderator @thiasaef
          last edited by

          @thiasaef if you want to forward then forward.. Restarting of unbound, yes clears the cache.

          I have not seen such issues, my unbound normally runs for days and days - restarts normally when I do something that restarts it, etc.

          
          [22.01-RELEASE][admin@sg4860.local.lan]/root: unbound-control -c /var/unbound/unbound.conf status
          version: 1.13.2
          verbosity: 1
          threads: 4
          modules: 2 [ validator iterator ]
          uptime: 323100 seconds
          options: control(ssl)
          unbound (pid 97316) is running...
          [22.01-RELEASE][admin@sg4860.local.lan]/root: 
          

          What is that like almost 90 hours..

          If you think 1 or 2 ms has anything to do with anything.. Then sure ok, forward if you want.. But I will resolve.. I have no want of sending all my queries to some service.

          The only possible reason I could see forwarding, is if they provided something like filtering that I wanted to leverage. Or your on a internet connection that has bad latency or peering, etc.

          If your unbound is restarting all the time - then cache is not going to be very good..

          But response from when cached is going to be less than 1 ms, your best time there is 9ms too google..

          You can also tweak unbound to do prefetching, so stuff you normally go too is more likely to be cached. And you can set to serve 0, so even if past the ttl you get the last IP of that fqdn, and then its relooked up in the background, etc. etc..

          You do you.. Which is why there are many options and configurations possible for a user to decide what they want to do, 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 24.11 | Lab VMs 2.8, 24.11

          T J 2 Replies Last reply Reply Quote 0
          • GertjanG
            Gertjan @thiasaef
            last edited by

            @thiasaef said in DNS Resolver Root Server Question:

            Resolver (pfSense @home):

            drill forum.netgate.com
            ;; Query time: 179 msec

            Ah lol. Let me try that one (using the resolver as a resolver == pfSense default DNS settings ) :

            drill forum.netgate.com | grep 'Query'
            ;; Query time: 0 msec

            There.
            0 or zero.

            Because : I've just read your forum post, so "forum.netgate.com" lices in my unbound cache. I guess it lives forever in my cache as I do what JP already said :

            4ba60cf9-a161-4146-aba9-4c104ea6bc12-image.png

            edit : 8.8.8.8 or 1.1.1.1 couldn't do this. If they would, after a day or so, they would have to cache all the existing host names on the internet. Just keeping that updated is already impossible. Indexing a cache that big (penta bytes cache size ? Bigger ?) wouldn't be a "x ms" thing any more.
            You've demonstrated it : after one hours, it really looked like that forum.netgate.com wasn't in the 1.1.1.1 cache anymore, so 1.1.1.1 had to resolve for you.
            You, on the other hand, woun't visit "every possible domain" on the Intranet every day, your DNS footprint will be small, maybe a couple of thousand host names ? and that is something unbound can handle just fine, and keep it updated.
            Let's check : Status > DNS Resolver : 700 entries.

            edit in edit :

            d2aa1d39-4bc0-4c5b-9aad-35052e74167a-image.png

            Restart the unbound service (see arrow) and then refresh the page : the cache won't be empty, as the cache was exported to a file before stop, and read back upon start ๐Ÿ‘

            so I let unbound populate his cache, and unbound keeps it updated. So it stays valid and up to date when I need it.
            If 'time' consumed for DNS handling was an issue for me, I guess I nailed it.

            And yes, I tend to keep unbound running as long as possible ;)

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

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

              @gertjan said in DNS Resolver Root Server Question:

              as the cache was exported to a file before stop, and read back upon start

              While I know this is possible - I did not think pfsense unbound was doing that?? Is that something pfblocker does or can do?

              [22.01-RELEASE][admin@sg4860.local.lan]/root: unbound-control -c /var/unbound/unbound.conf stats_noreset | grep cache.count
              msg.cache.count=5022
              rrset.cache.count=8956
              infra.cache.count=5704
              key.cache.count=379
              

              restart unbound

              [22.01-RELEASE][admin@sg4860.local.lan]/root: unbound-control -c /var/unbound/unbound.conf status
              version: 1.13.2
              verbosity: 1
              threads: 4
              modules: 2 [ validator iterator ]
              uptime: 66 seconds
              options: control(ssl)
              unbound (pid 10009) is running...
              [22.01-RELEASE][admin@sg4860.local.lan]/root: 
              
              [22.01-RELEASE][admin@sg4860.local.lan]/root: unbound-control -c /var/unbound/unbound.conf stats_noreset | grep cache.count
              msg.cache.count=29
              rrset.cache.count=129
              infra.cache.count=64
              key.cache.count=5
              [22.01-RELEASE][admin@sg4860.local.lan]/root: 
              

              While if unbound was restarting every few minutes or something - sure that would be problematic - more so you trying to look up something while it wasn't actually up.

              But even when doing a full resolve of something all the way down from roots, your taking a few extra ms.. If there is nothing wrong means nothing more than a few extra ms.. If your obsessing over a few ms in query time.. That can not even be noticed by human.. Lets say it takes 200 ms to resolve something... That is .2 of a second.. Do you really think that is going to cause a page load to be noticeable slower??

              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
              • T
                thiasaef @johnpoz
                last edited by thiasaef

                @johnpoz said in DNS Resolver Root Server Question:

                If you think 1 or 2 ms has anything to do with anything..

                No, but 170ms does and that's why I personally stopped using the resolver mode shortly after upgrading from 2.4.5-p1 to 2.5.2+, simply because I couldn't stand the performance impact any longer - not because I would prefer it.

                But response from when cached is going to be less than 1 ms, your best time there is 9ms too google..

                The initial response from google will be cached locally as well ...

                You can also tweak unbound to do prefetching ... And you can set to serve 0

                Yes, that works well if Unbound does not restart frequently - which it does if you run 2.5.2+ and have multiple end user devices directly attached to the firewall without an intermediary switch.

                You do you..

                Yes, but you were the one that said: "There is zero reason for any other dns service", which implies that anyone who does is stupid.

                @gertjan said in DNS Resolver Root Server Question:

                I guess it lives forever in my cache as I do what JP already said

                Only if you access the forum more often than once every hour.

                @gertjan said in DNS Resolver Root Server Question:

                edit : 8.8.8.8 or 1.1.1.1 couldn't do this ...

                Sorry, but you obviously don't understand what enabling "Prefetch Support" actually does.

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

                  @thiasaef said in DNS Resolver Root Server Question:

                  but 170ms does

                  no not really ;) 0.17 seconds... Your talking the blink of an eye time...

                  That is a full resolve time.. Happens now and then when your looking up something that needs to be fully resolved..

                  Again you do you.. But being worried about a few ms here or there is not very productive... Your not flash trading stocks ;) You a high frequency stock trader worried about nano seconds ;) heheh

                  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

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    thiasaef @johnpoz
                    last edited by thiasaef

                    @johnpoz said in DNS Resolver Root Server Question:

                    0.17 seconds... Your talking the blink of an eye time...

                    times the number of sequentially executed queries per page. Example (cnn.com):

                    ... more than 60 DNS queries in total.

                    johnpozJ GertjanG 2 Replies Last reply Reply Quote 0
                    • johnpozJ
                      johnpoz LAYER 8 Global Moderator @thiasaef
                      last edited by johnpoz

                      @thiasaef queries are not sequential. If you load up a website that has say 4 or 5 different fqdn to load stuff from.

                      It doesn't have to wait 170 ms for fqdn1 to be resolved before it asks for fqdn2, etc..

                      If you look at first query there, and then last query your talking a total of .471 seconds..

                      Your dns query time is going to be a very very small fraction of the load time of that site..

                      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

                      T 1 Reply Last reply Reply Quote 0
                      • T
                        thiasaef @johnpoz
                        last edited by thiasaef

                        @johnpoz said in DNS Resolver Root Server Question:

                        @thiasaef queries are not sequential.

                        Agreed, but some are definitely interdependent.

                        Your dns query time is going to be a very very small fraction of the load time of that site..

                        Same test with Unbound in resolver mode:

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

                          ... and yes, if you want to look at cnn.com, then half the planet has to made aware of that.
                          Every big iNet player does that these days.

                          On the other side : cnn.com isn't doing DNSSEC ( "DNS fact checking" ?! ).
                          If the did, you could see a triple the number of queries, and some of them will be to big for UDP, so TCP (slower) will kick in.

                          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 0
                          • J
                            jpvonhemel @johnpoz
                            last edited by

                            @johnpoz said in DNS Resolver Root Server Question:

                            I have no want of sending all my queries to some service.

                            I too do not want my ISP or another third party, ie google, comcast, or cloudflare building a browsing profile and profiting, but I also would like performance to be optimal at the same time. Seems fair to sai that unbound enhances privacy out of the box.

                            Privacy seems all but lost these days, but I want to limit the loss and avoid being someone's product.

                            1 Reply Last reply Reply Quote 0
                            • T
                              thiasaef
                              last edited by thiasaef

                              Actual page load time (PerformanceTiming.domComplete - PerformanceTiming.navigationStart) of www.bbc.com:

                              Forward [1st run || 2nd run] || Resolve [1st run || 2nd run]
                                        0.87 s || 0.89 s   ||           1.65 s || 0.84 s
                              

                              @gertjan said in DNS Resolver Root Server Question:

                              On the other side : cnn.com isn't doing DNSSEC

                              97 % of all .com domains are unsigned as of now: https://rick.eng.br/dnssecstat/

                              @gertjan said in DNS Resolver Root Server Question:

                              If the did, you could see a triple the number of queries

                              ftp.isc.org supports all bells and whistles related to DNSSEC:

                              Resolve [1st run || 2nd run] || Resolve +DNSSEC [1st run || 2nd run]
                                        1.05 s || 0.95 s   ||                   1.28 s || 0.96 s
                              
                              1 Reply Last reply Reply Quote 0
                              • N NOCling referenced this topic on
                              • First post
                                Last post
                              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.