I’ve spent most of today trying to work this out. I’d like to log all DNS queries to a file, preferably on my NAS (QNAP TS253A).
I thought it should just be a case of setting up a Log Rule for DNS and setting it to log remotely. However, while something is going into the log, it’s clearly not all DNS requests from users. If anything, it seems to be only DNS requests initiated by the router itself. For example:
Has anyone been able to log DNS requests sent by actual users? I had thought about creating a ‘permit’ firewall rule for DNS messages coming in from the LAN, but that doesn’t seem to send anything to my remote log file.
The router is already configured as the DNS server for all local devices - with Google DNS configured as the upstream DNS service. Not sure what you mean by redirect DNS to the router?
I meant that you can use action=redirect in /ip firewall nat for DNS requests - that will force the use of your DNS even if a client attempts to connect to any other DNS server.
You can see in my Splunk for MikroTik how I do log all DNS request to a tool that can easy analyze all DNS request. http://forum.mikrotik.com/t/tool-using-splunk-to-analyse-mikrotik-logs-3-3-graphing-everything/121810/1
'Whit drop down list, you can select a singel user and see for a given time all DNS request.
Remember that a visit to just one web site may log 10-20 DNS request to get all advertising, tracker, plugins +++
Wow Jotne! That looks awsome. I’ve been wanting to learn about Splunk for a while, as I think we might start using it at work for our SIEM, so it will be good to have a shot at home first. If I get get those sorts of graphs working, I’d be extremely happy!
What do you use to collect the script outputs from the router? Do you have a PC/server that’s left on all day and night?
I have a Linux server ( highly recommend Linux, but can be done with Windows server)
Do not need to be a big server for this, just som old PC would do.
Running 24/7