Create Dynamic Custom Hosts File


Occasional Visitor
my geo-unblock dns provider publishes a .hosts file (via a static url) that gets regular updates. i would like to reflect those updates on my router. how can i create a daily cronjob to

1. download the .hosts file from my provider
2. replace the contents of /jffs/configs/dnsmasq.conf.add with the download
3. restart the router or the relevant (sub)system to update its hosts file

many thanks in advance!


Part of the Furniture
What format is the hosts file from your provider? Standard ip host_name?


Part of the Furniture
I'd use a separate file to avoid having to completely restart dnsmasq. Then one time add the line


to /jffs/configs/dnsmasq.conf.add

Then since the dnsmasq hosts files aren't dynamic, you need to issue

killall -SIGHUP dnsmasq

to cause the host file to be re-read after you download it.

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!