Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
systemd-resolved: How to clear DNS cache? #940
Comments
|
That sounds wrong. resolved does not save its cache to disk, so I don't see how restarting it does not clear the cache. Moreover, what's the usecase for forcibly clearing the cache (outside of DNS debugging I guess)? |
|
To verify, please run systemd-resolved with SYSTEMD_LOG_LEVEL=debug in its Environment=. You will then see "Cache hit" and "Cache miss" messages. |
paulmenzel
commented
Aug 12, 2015
|
|
Hm, lots of stuff that could be going wrong here. My guess would be that resolved is pointing at a different DNS server than what you use for dig (in case you are not aware dig circumvents nss/resolved completely). If you could try with debug output from resolved we would see what is going on. |
paulmenzel
commented
Aug 12, 2015
|
I added What command can I run to force a name resolution over systemd-resolved? |
paulmenzel
commented
Aug 12, 2015
|
@falconindy told me in systemd@irc.freenode.net to use
Judging from the |
paulmenzel
commented
Aug 12, 2015
|
|
@paulmenzel resolved isn't even active in your configuration. you need to use |
paulmenzel
commented
Aug 12, 2015
|
What does I ran |
|
'dns' uses /usr/lib/libnss_dns.so. 'resolve' would use /usr/lib/libnss_resolve.so, and so on... |
paulmenzel
commented
Aug 12, 2015
|
|
@paulmenzel yes, glibc has to read /etc/resolv.conf for name resolution functions to work. |
|
@paulmenzel in case it is still unclear: you need to change 'dns' into 'resolve' in /etc/nsswitch.conf, otherwise this is not a systemd issue. |
|
FWIW, debian does not yet ship the resolve nss module. AFAICT the only issue here is that there is no doc for nss-resolve and how is it useful (ie, why would I want to go through resolved instead of directly to the dns servers) |
|
And this info was not here but on IRC I gathered paul was using debian. |
paulmenzel
commented
Aug 13, 2015
|
As @fsateler wrote, Debian 8.1 (Jessie) is used. It looks like, systemd-resolved is not yet integrated that well in Debian 8.1 and I made some wrong assumptions. |
paulmenzel
closed this
Aug 13, 2015
poettering
added
the
resolve
label
Aug 16, 2015
q2dg
commented
Jan 3, 2018
|
On Ubuntu (17.10) "libnss-resolve" package must be installed on hand |
paulmenzel commentedAug 12, 2015
Sometimes it’s needed to clear the DNS cache. Restarting systemd-resolved doesn’t do it. How can the DNS cache be cleared?