Make dnsmasq ignore specific entries in /etc/hosts

dnsmasqdomain-name-systemhostshosts-fileignore

I've set up a machine running dnsmasq, essentially serving its /etc/hosts file. However, there are specific entries which I want in that machine's /etc/hosts, but I don't want served. How can I make dnsmasq not serve them?

Best Answer

If you don't want your system to use those entries in your host file, why can't you simply remove them?

Do you have other enteries in your host file that you do need to be served? You could just have DNSMasq skip the system-wide host file --no-hosts, and you can point DNSMasq at an alternate hosts file that has the entries you want --addn-hosts.

-h, --no-hosts
  Don't read the hostnames in /etc/hosts.

-H, --addn-hosts=<file>
  Additional hosts file. Read the specified file as well  as  /etc/hosts.
  If  -h  is  given,  read  only  the  specified file. This option may be
  repeated for more than one additional hosts file.
Related Topic