View Full Version: My Hosts File Is On My Router

abelhadigital > HostsMan > My Hosts File Is On My Router



Title: My Hosts File Is On My Router
Description: Could Hostsman Maintain File On Router?


johnjinsf - October 21, 2008 04:34 PM (GMT)
I have a Linksys WRT54G router running Tomato 1.21 firmware.

Some time back I came across a posting detailing how to move the HOSTS file off the computer and onto the router using a script which I did.

The script downloads the HOSTS file from http://www.mvps.org every Friday at 11.00pm to the router, edits the file and then creates a file in /etc/hosts.

Then the script sends a signal to dnsmasq to re-read the hosts file and whenever the router has an inbound url that is in the HOSTS file
it substitues 0.0.0.0 (in preference to 127.0.0.1) and thus the url is blocked.

e.g.If the url was an advertisment on a web page. that area of the webpage is now void of the advertisement.

I am wondering if there would be any way to get Hostsman to read/write to the router HOSTS file rather than the one on the computer?

Many thanks

John J
San Francisco

rloureiro - October 26, 2008 08:28 AM (GMT)
Sorry for taking so long to reply.

I believe it's possible, but first I have to figure out how.

Also, this is probably going to take a long time to be implement, as I have other features that I consider more important to implement first.

Anyway, thanks for the suggestion.

YoKenny - October 26, 2008 08:56 AM (GMT)
What I would do is to download hpHosts file and merge the two HOSTS files ensuring that they delete duplicates so that both of the files are loaded into the router:
http://hosts-file.net/?s=Download

I do not know if the script erases the old HOSTS file then downloads a fresh file that is loaded.

Maybe if you included the code of the script file here by using the CODE button then copy-n-paste its contents so I could have a look at it to see what it does.

CODE
This is a sample of a code box




Hosted for free by InvisionFree