You can use the following command to send signal USR1
(User-defined signal 1) to systemd-resolved
:
sudo pkill -USR1 systemd-resolve
This will NOT stop the service. It just tells systemd-resolved
to write all the current cache entries (and some other information) to the system log.
You can then export the log messages written by systemd-resolved
to a text file with the following command:
sudo journalctl -u systemd-resolved > ~/resolved.txt
Open the text file generated this way in the text editor of your choice and search for CACHE:
. After this, the list of cache entries will follow.
Please note that the text file might contain several lines containing CACHE:
.