I have configured dnsmasq (see https://wiki.debian.org/HowTo/dnsmasq) but it doesn't seem to do what I expected. Its cache is somewhat working, so that when I for example do
dig ubuntu.com twice, first time it takes some time, second time it's instant.
But when I do this a moment later, or after my secondary dns server is changed (I connect to vpn or something) all records seem to wipe out.
Is there a way to set up some proper, working dns cache, that doesn't forget everything in a moment, but keeps its data for at least several days? so that even if I disconnect from network, I could still resolve hostnames I tried to resolve before?
dnsmasq improves the caching "a little bit" I would like to improve it significantly