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

    Remote Log DNS Reply

    Scheduled Pinned Locked Moved pfBlockerNG
    20 Posts 6 Posters 2.0k Views 7 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.
    • L Offline
      Lockie
      last edited by

      K I'm a bit confused as to if it is or is not possible. I was hoping there might be a written up guide on how to if it was possible.

      I think ideally I'd like it if I only logged certain local IPs and there DNS replys. To keep the logs smaller and more focused.

      johnpozJ keyserK 2 Replies Last reply Reply Quote 0
      • johnpozJ Offline
        johnpoz LAYER 8 Global Moderator @Lockie
        last edited by

        @Lockie You can log queries and replies.. But yeah I believe Keyser is correct that it doesn't log what was the IP returned to the client..

        Lets say 192.168.1.100 asks for www.domain.com, you will see that they got a reply for www.domain.com and it was say an A record, etc. but you won't see for example that the answer was IP 1.2.3.4..

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

        1 Reply Last reply Reply Quote 0
        • keyserK Offline
          keyser Rebel Alliance @Lockie
          last edited by keyser

          @Lockie Yeah, its not possible straight up to have it logged to a remote server. The best you can achieve is ask pfBlockerNG to do reply logging. That will record what you are looking for - but only to a local logfile.

          To me it seems quite logical to want the DNS reply IP addresses logged as well. That way you can correlate “near real time” IPFIX flow data to what DNS names the client requested to inititate that session. Without the IP, your SIEM could try and reverse lookup the IPs in flow data (not really working AT ALL), so that leaves having the siem do all the DNS requests again when enriching the flowdata for a client, and then Round Robin DNS or other distributed host resolution methods becomes a HUGE problem - leaving IPs in flow data that cannot be correlated.

          Love the no fuss of using the official appliances :-)

          L J 2 Replies Last reply Reply Quote 0
          • L Offline
            Lockie @keyser
            last edited by

            @keyser this part

            "Lets say 192.168.1.100 asks for www.domain.com, you will see that they got a reply for www.domain.com and it was say an A record, etc."

            Is all I want. I'm not interested in the IP of the domain. If I've understood correctly.

            keyserK GertjanG 2 Replies Last reply Reply Quote 0
            • keyserK Offline
              keyser Rebel Alliance @Lockie
              last edited by keyser

              @Lockie Okay - sure. That is intirely possible:

              In SERVICES -> DNS RESOLVER under custom options add:
              This will add DNS replies in your resolver.log. You can syslog that to a remote host using the built in syslog feature in the pfSense log setup (STATUS - SYSTEM LOG -> SETTINGS)

              8d00d1d8-79f5-4911-ae3a-4037b956cdfe-image.png

              You do not need the pivate-address part. Thats in mine to prevent response and logging of IPv6 names (I’m IPv4 only)

              Love the no fuss of using the official appliances :-)

              L 1 Reply Last reply Reply Quote 1
              • GertjanG Offline
                Gertjan @Lockie
                last edited by Gertjan

                @Lockie said in Remote Log DNS Reply:

                "Lets say 192.168.1.100 asks for www.domain.com, you will see that they got a reply for www.domain.com and it was say an A record, etc."

                Another approach.
                Install and activate pfBlockerng.
                No need to add any DNSBL or IP feeds.

                From now on :
                615020ba-3b4e-4191-a7eb-fe5c02b86c9f-image.png

                This dns_reply file contains info like :

                DNS-reply,Jun 6 08:16:09,cache,A,A,3125,devices.liveradio.fr,192.168.1.124,90.84.243.75,FR
                

                The device 192.168.1.124 was asking for the A record of "devices.liveradio.fr" and it got back, from the cache, "90.84.243.75".

                As pfBlockerng is 100 % open source, it won't need rocket science to add to the place where lines are added to this /var/unbound/var/log/pfblockerng/dns_reply.log file so it also send out to the local syslog, the one you've set up to also do remote logging to a remote syslog server.

                edit : humm. @keyser solution seems simpler 👍

                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
                • L Offline
                  Lockie @keyser
                  last edited by

                  @keyser out of interest, would this have negative performance impacts in any significant way?

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

                    @Lockie the logging of replies and or queries would put a hit on the overall performance of unbound. But to be honest unless you doing a crazy amount of dns - I mean crazy amount I don't see how it would be of concern.

                    Generally speaking, dns is not an overall resource intensive sort of thing.. Even in an enterprise with 1000s of clients I don't see how it could be much of an issue.. Now if you got something going bat shit insane with the amount of queries its doing... My alexas lost their minds when the internet was out for a bit, and they had done millions of queries each in less than 24 hours.. Unbound was still answering.. But glad I wasn't logging all of those ;)

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

                    L 1 Reply Last reply Reply Quote 0
                    • L Offline
                      Lockie @johnpoz
                      last edited by

                      @johnpoz K thank you thats good to know.

                      1 Reply Last reply Reply Quote 0
                      • L Offline
                        Lockie
                        last edited by

                        Currently struggling to setup remote log receiving on my NAS :( grr, I don't appear to be getting anything into my Synology NAS in terms of the logs I setup on pfsense. Here are the NAS settings:
                        7ee849dc-c10a-4617-9d7b-62b96ff66f4d-image.png

                        Here is pfsense:
                        a2b839c5-ddd7-479c-8836-bec0782cefa3-image.png

                        See anything obviously wrong?

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

                          @Lockie I just turned on logging to my nas.. And seems to be working

                          query.jpg

                          Are you seeing entries in your local log when when you go to logging and pick the resolver?

                          resolver.jpg

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

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

                            @Lockie

                            I picked 'LAN' as my Syno is on my LAN.

                            c9bf65d4-78c2-4ac7-8390-f25284adebef-image.png

                            'Any' might seem fine, but what if it decides to use IPv6 ?
                            Or using another interface ?
                            I'm not sure, but sure about the fact that the interface is LAN (for me).

                            I added the Syno IPv4 :

                            90599f39-f38a-4bda-8eed-7f0292992e0a-image.png

                            192.168.1.4 is my actual log collector.
                            I added 192.168.1.33, my Syno.

                            My Syno told me I had to install this first :

                            22b3727f-f7e9-4617-a86a-e87030e59c7b-image.png

                            The first time adding a "Logs receiving" setup, Syno asked me to assigne a folder to store the logs.

                            These are my settings :

                            1ed13f48-2bbc-4b16-994d-287dd47a3e77-image.png

                            1d698fd1-59bf-442e-9822-6e35ababea78-image.png

                            From now on, my Syno start to receive logs from pfSense :

                            4593b74c-f9b6-4232-ad72-d15813ba7418-image.png

                            edit #metoo ! it works.

                            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
                            • L Offline
                              Lockie
                              last edited by

                              Thanks all, you've been so helpful.

                              Switched it to LAN and I've now go what I needed.

                              Many Thanks ALL!!!

                              1 Reply Last reply Reply Quote 1
                              • J Offline
                                jrey @keyser
                                last edited by

                                @keyser said in Remote Log DNS Reply:

                                but only to a local logfile.

                                Not entirely correct if you are willing .. anything is possible

                                @johnpoz said in Remote Log DNS Reply:

                                would put a hit on the overall performance of unbound. But to be honest unless you doing a crazy amount of dns - I mean crazy amount I don't see how it would be of concern.

                                for the record - I run about 60 clients behind a 2100 and there are no speed issues with dns resolution. I'd like to define crazy ☺ but at the level of about 10,000/hour I'm not there yet ...one day when I'm feel bored I might load it up and see where it breaks -- just for fun.

                                This is from my Graylog server and is in real time.

                                Screen Shot 2024-08-27 at 1.18.30 PM.png

                                While you are there, may as well grab DNSBL goodies as well.

                                Screen Shot 2024-08-27 at 1.22.06 PM.png

                                Based on the DNS Reply you can make all kinds of pretty graphs..
                                Screen Shot 2024-08-27 at 1.43.15 PM.png

                                May as well grab unified while your at it ..

                                Screen Shot 2024-08-27 at 1.47.18 PM.png

                                And finally the Synology (we run a small DNS on this device for some "special" use case, and the volume of "hits" is very low, but it is real time and has no issues "Feeding the data to the Graylog". Synology provides no way to send DNS records to another logging server, pretty much everything else but not DNS.. again if there is a will there is a way.

                                Screen Shot 2024-08-27 at 1.24.28 PM.png

                                😇 only / maybe 10 lines or less of code to make the magic happen. I'm okay with that, for accomplishing the goal go logging.

                                Bottom line for me is "Can't do that, is simply not an option"

                                M 1 Reply Last reply Reply Quote 0
                                • M Offline
                                  mcury Rebel Alliance @jrey
                                  last edited by

                                  @jrey can you share how you are sending DNS data to graylog ?
                                  I've trying to accomplish that without any success.

                                  dead on arrival, nowhere to be found.

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