I'm using dnsmasq on OpenWRT.

Is it possible to map certain hostnames for DNS requests coming from a specific client? The ultimate goal in my case is to map certain hostnames to to block them.

For example, the /etc/hosts file changes the mapping for all requests, but what if you only wanted client X to map a certain hostname?

I'm able to block certain IPs for a client MAC with firewall, but I want to block certain hostnames specifically.


1 Answer 1


You could start up a second DNSMASQ with DNS only on a virtual machine or real interface, and assign the second DNSMASQ server from the first server


And then on the second server you could add:


But the easiest way to do this if you have access to the host file on the client is to add the following to it: baddomain.com

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .