I'll complete the text with the process management information:
This script performs DNS TXT record lookups once per minute for 24 hours straight. Each lookup uses a unique random name in the format 'delver-xxxxxxxx'.
- Python 3.x
- Your computer must stay awake the entire time (disable sleep/hibernate)
- Internet connection for the full 24 hours
First, copy and paste the below Python code into a file called dns_lookup.py
. Then, run it by:
on macOS/Linux:
python3 dns_lookup.py > output.log 2>&1 &
on Windows:
python dns_lookup.py > output.log 2>&1
Wherein dns_lookup.py
is the path to your above created file, and output.log is the path to your desired output log file; the script will write all output thereto and run in the background.
If at any point you wish to stop the test you can do so by running the following:
on macOS/Linux:
ps aux | grep dns_lookup.py # Find the process ID (PID)
kill <PID> # Stop the process
on Windows:
Get-Process -Name python | Where-Object { $_.CommandLine -like '*dns_lookup.py*' } | Select-Object Id # Find PID
Stop-Process -Id <PID> # Stop the process
Note: Your computer must not go to sleep during the test!