First to restart DNSMasq use:
There are a few things to note:
There are two main files /tmp/dnsmasq.conf and /tmp/hosts.
- When you change dnsmasq.conf and restart dnsmasq it will revert back to the way it was
- You can edit /tmp/hosts and restart DNSMasq and it will read from /tmp/hosts
- Having an entry in /tmp/hosts and /tmp/dnsmasq.conf will cause conflicts
- /tmp/hosts gets overwritten upon reboot
- Your best bet is to get it working, then setup a start-up script in dd-wrt. >> See https://wiki.dd-wrt.com/wiki/index.php/Startup_Scripts for howto, I used WebGUI for convenience.
- I couldn't write files to my router so I store scripts on NAS
My example test case was blocking YouTube upon initial boot and creating a script to manually block and unblock it afterwards. It was a fun adventure!
I used the DD-WRT WebUI to setup the following command at startup which defaults to blocked:
- If I wanted it unblocked by default I could omit this step
I then created two scripts to be executed over SSH: