3

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 127.0.0.1 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

1 Answer 1

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

dhcp-host=00:51:99:72:8f:89,set:specialhosts,192.168.1.2
dhcp-option=tag:specialhosts,option:dns-server,192.168.1.2

And then on the second server you could add:

address=/baddomain.com/127.0.0.1

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:

127.0.0.1 baddomain.com

You must log in to answer this question.

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