Display DNS cache

Sapir

New Member
Joined
Dec 2, 2020
Messages
14
Reaction score
1
Credits
122
Hi everyone!
I have a question about DNS cache . I've tried to see dns cache records in linux with the command similar to windows and with no success. After quick search i saw that i need NSCD daemon And after that Run the command service nscd status or sudo service nscd status But it dose'nt work!

So i wanted to ask .. How can i display dns records in linux? I know that in windows i can display it in : ipconfig/displaydns So i wanted to know how can i do this in linux command line?

Thank you in advanced:)
 


OP
S

Sapir

New Member
Joined
Dec 2, 2020
Messages
14
Reaction score
1
Credits
122
Tnx!!
Do you know/have link about how to delete dns?(equivalent to flushdns in windows)
 

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
8,084
Reaction score
6,944
Credits
65,620
This answer should do the trick:

 
OP
S

Sapir

New Member
Joined
Dec 2, 2020
Messages
14
Reaction score
1
Credits
122
I have try this, and "Current Cache Size: 0" but when i run this commands :

$sudo systemd-resolve --flush-caches
and then:

$sudo killall -USR1 systemd-resolved
$sudo journalctl -u systemd-resolved > ~/dns-cache.txt

i still get in "dns-cache.txt" sites that i have been visit month ago..
it's the only way to do that?
 
Last edited:

Vrai

Well-Known Member
Joined
Mar 16, 2019
Messages
1,060
Reaction score
1,002
Credits
4,055
I have try this, and "Current Cache Size: 0" but when i run this commands :

$sudo systemd-resolve --flush-caches
and then:

$sudo killall -USR1 systemd-resolved
$sudo journalctl -u systemd-resolved > ~/dns-cache.txt

i still get in "dns-cache.txt" sites that i have been visit month ago..
it's the only way to do that?
Excellent question about DNS Cache! Thanks for bringing it up.

I don't have an answer - but an observation.

When you visit a site from a month ago, is it possible that your machine reaches out to the nearest DNS Resolver and refreshes the local DNS Cache? This would happen very quickly.

Perhaps after clearing out the local DNS Cache it is refreshed whenever trying to reach any site.

Just throwing that out there. ¯\_(ツ)_/¯
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top