I use internet (personal connection from ISP). My operating System is Ubuntu 18.4. I am aware of /etc/hosts file, but it has limitation with wild card entries (to block websites).
I wanted to know if Ubuntu does caching of DNS or do I need to install some other tool? There is a Network Manager installed. And Systemd is the daemon manager. Do these tools have ways of managing DNS? Do, I need to use Dnsmasq?
I have read that many people prefer Dnsmasq, but I am not sure why is it preferable? I am not sure if this can already be done by Networkmanager or systemd.
EDIT:
My goal, is to block websites and do caching of DNS if it is significantly beneficial? Also, I am not a web developer.
Can I use wildcards to block websites without dnsmasq?
@earthmeLon questioned: Also, are you trying to block or allow access to more of the Internet? Should you be blacklisting or whitelisting?
- I am trying to blacklist, as I don't know if I might need to access some other websites in the future.
Your system will honor TTL, which 'caches' the response for some time. You don't want to ignore these values or mess with these at all.
Many people prefer
dnsmasq
(I have to assume) because it gives them more control of the DNS responses. In most scenarios,dnsmasq
is set up as a sort of proxy to query other DNS servers for most domains, but allow you to customize or edit certain domains.bind
is a more robust DNS server.An example would be if you are a developer and (before Google bought
.dev
TLD) you wanted to set upnic.dev
on your computer or LAN such that the domain resolves to an IP instead of erroring that their is no record.It's great that you are interested in these technologies, but don't mess up your main system playing around, especially if you're not addressing a problem. Set up a VM or another system and play around with
dnsmasq
orbind
if you have the interest or need.