0

I'd like to setup dnsmasq as DNS-only server for blocking certain domains. But instead of having it return 127.0.0.1 or 0.0.0.0 or such, I'd like it to respond with a No such name. just as if the name does not exist at all.

How to I filter certain domains?

1

You could make dnsmasq authoritative for those domains with the --auth-zone option, and simply not add any DNS records for those domains.

| improve this answer | |
  • You can't configure it inside dnsmasq.conf, can you? Adding a lot of hosts using the command line parameters seems not to be a practicable. – bot47 Apr 27 '14 at 10:22
  • 1
    All dnsmasq command line options can also be used as configuration parameters. – Dennis Kaarsemaker Apr 27 '14 at 10:24
  • OK, works. Although this approach seems quite contraintuitive to me. – bot47 Apr 27 '14 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.