0

I've created a hotspot for children and I want to easily be able to add/remove websites from my blacklist.

My hotspot is a linux machine running 'hostapd' as the hotspot and 'dnsmasq' as the dhcp/dns server.

It's working, and I can block a site bay adding it to my dnsmasq conf file '/etc/dnsmasq.conf' like so:

address=/badwebsite.com/127.0.0.1

but I need to log into the server, update that file, and then kill and restart dnsmasq to add or remove a site.

Is there a way to maintain a dynamic list of blocked sites, either with dnsmasq, hostapd, or some other software, so that I can just update a list that is checked dynamically at runtime for blacklisting or whitelisting websites?

benino
  • 577
  • 2
  • 6
  • 16
  • 1
    That will depend on where/how you want to implement that list. If you're OK with editing a file on the machine and used an inclusion directive, e.g. `addn-hosts=/tmp/hosts`, for dnsmasq and modified that file you could then use `inotifywait` in a bash-script to watch for write-close events on that file and have it send a HUP to dnsmasq that would speed things up. – tink Jan 21 '21 at 00:49
  • 1
    following up on that ... if you wanted to avoid having to log into it (and assuming that you're using a linux workstation) you could use sshfs to remotely mount the `/tmp` directory and edit the file *locally* (in a manner of speaking). – tink Jan 21 '21 at 01:03
  • thanks so much. your answer is much appreciated. This strategy opens up lots of options for me. I wasn't aware of a way to update without having to stop and restart dnsmasq. – benino Jan 23 '21 at 04:12
  • Pleased to hear that =} – tink Jan 23 '21 at 04:25

0 Answers0