Is it true that Ubuntu doesn't have DNS cache by default and what options I have to enable it ? Is bind9 option that can enable caching of DNS ?
Asked
Active
Viewed 5,208 times
5
-
Ubuntu has a DNS cache, yes. You don't need to set up bind9 to set up an internal DNS cache on your computer – Thomas Ward Apr 28 '16 at 11:10
-
Where it is stored ? – user3448600 Apr 28 '16 at 11:36
1 Answers
4
Ubuntu Desktop have dnsmasq-base package built-in in NetworkManager, but with the dns cache function disabled, you can check in your logs:
zgrep dnsmasq /var/log/syslog* | grep disabled
....
dnsmasq[1546]: started, version 2.68 cache disabled
....
you can install dnsmasq if you are using Ubuntu Server and this have cache enabled by default.
If you are in Ubuntu Desktop, you can enable cache in dnsmasq-base/network-manager with this:
add one file in /etc/NetworkManager/dnsmasq.d/
sudo vim /etc/NetworkManager/dnsmasq.d/cache
add this line:
cache-size=1000
and after this in command line:
sudo restart network-manager
try to NOT install dnsmasq in Ubuntu Desktop, enable caching with dnsmasq-base. If you are in Ubuntu Server, install dnsmasq if is not already installed.

Yonsy Solis
- 862
- 2
- 8
- 20
-
1dns cache is disabled to reduce the risk of dns poisoning attacks, e.g. from others on free wifi network on other users on a multi-user host. See discussion at What happened to the talk about implementing per-user dns cache? : Ubuntu – nealmcb Apr 13 '17 at 16:40