Article 57EPV TCPDUMP - How do I get it to run at startup/boot

TCPDUMP - How do I get it to run at startup/boot

by
eladZ1i8
from LinuxQuestions.org on (#57EPV)
Greetings every one. We are new to Linux. The entire family changed over to Linux a couple of weeks ago.
In regards to tcpdump.
We want to run the following to display a continuous report of all dns queries:
This works well; however, how do we get it to run automatically when we start a computer.
OS is CentOS8.2.
This is what we use.

mkdir /home/user/Documents/dnslogs

script -q -c "sudo tcpdump -l port 53 2>/dev/null | grep --line-buffered ' A? ' | cut -d' ' -f8" | tee /home/user/Documents/dnslogs/"$(date +"%Y_%m_%d_%I_%M_%p").log"

Help would be greatly appreciated.

thank you
eladlatest?d=yIl2AUoC8zA latest?i=xdZcnEts0yI:tMg5LN4GAWA:F7zBnMy latest?i=xdZcnEts0yI:tMg5LN4GAWA:V_sGLiP latest?d=qj6IDK7rITs latest?i=xdZcnEts0yI:tMg5LN4GAWA:gIN9vFwxdZcnEts0yI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments