Anyone know of a way for me to setup a separate host file, or send different responses, from DNSMasq to specific PCs on my network?

Specifically, if I wanted to block youtube, or facebook, or etc. from my child's computer at MAC ab:cd:00:01:02:03, my thought is to add entries in the DNSMasq host file such as: facebook.com, youtube.com

But I would not want to block these for the entire family, only for his/her computer.

Thanks for any suggestions.

bumped to the homepage by Community 2 days ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


DNSMasq conditional capability rely mostly on its tagging mechanism and it is only related to its DHCP side.

One solution would be to first use the DHCP side of DNSMasq to tag which host is "child" and which is "grownup":

# grownup network

# child network

So, conditionally set dhcp-option to attribute a specific DNS resolving chain to "grownup" hosts (assuming and are your DNS servers and is your DNSMasq box IP address):

# options

From there, "grownup" host will directly resolv through your ISP DNS and the "child" ones would use DNSMasq resolving chain (or any other DNS server sitting on your DNSMasq box).

Finally adding a few host-record or a addn-hosts option:


For more about about DNSMasq:

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.