Posted: Thu Apr 25, 2013 1:58 Post subject: ad-blocking with JFFS2 filesystem - manually edit hostlist
Hi to everyone, i will explain how to configure your DD-WRT for ad-blocking using JFFS filesystem to manually import your adblock hostlist.
1) Open your web browser and Login to your router by entering its ip address:
http://192.168.1.1 or whatever
2) Go to Aministration/Management/JFFS2 Support
JFFS2 -> enable
Clean JFFS2 -> enable
Hit Apply settings button
3) Go to Services/services/Secure Shell
SSHd -> enable
SSH TCP Forwarding -> Disable
Password login -> enable (your router login pass)
Port -> 22
Authorized Keys -> 'empty'
Hit Apply settings button
4) Now we will create a good hosts.txt file based on MVPS and YOYO lists.
Go http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts;showintro=0&useip=0.0.0.0 and select from first line "0.0.0.0 101com.com" to the end and copy paste in a new txt document called hosts.txt
To import MVPS hosts with the correct format, that is '0.0.0.0 host.example' you will need to run a linux computer and execute this code on a terminal:
Now you can merge both YOYO and MVPS hostslist all in the same hosts.txt
5) Now is time to add to the list whatever hosts you want to block, as pornography, other pourposes or just a webpage you dont want to see more.
6) When hosts.txt is ready you want to upload and save it on your router,
Download and install WinSCP program from:
http://winscp.net/eng/download.php
7) Run WinSCP, in the main window type:
- Select protocol SCP
- Your router ip (192.168.1.1)
- Port (22, as default)
- Login: root (always is root)
- Password: your router login password
- Now a new windows opens where you can browse your PC and your router filesystems, in the router side go up to / and find /jffs directory, open it, and uplad here your hosts.txt file.
Now login the router from browser again and go to:
- Administration/commands
- Copy paste this script:
Code:
#!/bin/sh
if test -s /jffs/hosts.txt
then
grep addn-hosts /tmp/dnsmasq.conf ||
echo "addn-hosts=/jffs/hosts.txt" >>/tmp/dnsmasq.conf
killall dnsmasq
dnsmasq --conf-file=/tmp/dnsmasq.conf
fi
- Hit Save Startup button
9) Go to Administration/management/cron
- Cron -> enable
- Aditional cron jobs -> * 1 * * * root /tmp/.rc_startup
- Hit Apply settings button
10) Go to Services/Services/DNSMasq
- DNSMasq -> Enable
- Local DNS -> Enable
- Additional DNSMasq Options -> 'empty'
- Hit apply setting button
- Hit reboot router button
11) To test if the configuration is working we can run a terminal (Windows key + R, cmd, Intro) and type:
- nslookup zedo.com
- Will see our router giving the ip 0.0.0.0 for that zedo.com domain, if not it's because something is wrong
Finally we are on bussiness! blocking advertisements from hosts.txt file.
The advantage of this system is that we can edit the block list as we want, and even add our own ideas to block any domain we want, and then upload it to the router again easily using WinSCP program.
The router loads on memory the list always (even offline)
We can add any tematic hostlist, as tracker domains, adult content domains, and other good ideas.
A personal observation i found is that facebook uses "connect.facebook.net" to track us on a lot of sites having this "like" links, so i added this domain to hosts file
Hope this post helped you to configure your ad-blocking on your DD-WRT routers in a different way!!
Is there an easier way to do this for us Mac users(cough cough).
T.I.A.
There are 2 ways for ad-blocking, you can do it at Network level tweaking your router as i explained in this post, another way is at Computer, editing your hosts.ics file (using Windows and Internet explorer) or installing an addon on your internet browser, like Ad Block Plus (for Firefox or Chrome).
Im sorry that im not experimented with Mac OS but you can try using a search engine.
I think that your best solution (and easier) is not to tweak a router, but possibly the best way for you is install an addon for your Safari browser.
Try Safari AdBlock at http://safariadblock.com/
If you mean that you are trying to do what i explain in the post, the only problem you can have is:
1) you need to download and install a SCP client for MAC
2) To download the MVPS host list in correct format, you will need Linux, so you can try to download any light Linux distribution, install it to a USB pendrive, and run it from the USB, see http://www.pendrivelinux.com for that.
Yes I already have a browser plugin that is suppose to block ads but thought I could take it farther by tweaking ddwrt a bit.
Sadly, I am not savvy enough to figure it out on a linux.
Thank you,
Pamela
If you want to try tweak your ddwrt and your problem is linux, i can send to you or post here the MVPS list in the correct format and you can upload it directly to your router, or merge it with the YOYO list and upload it. Let me a moment and i will post here...
psykotrance, you’re a sweetheart!
Without abusing your time I better learn how to upload the file you posted.
I m taking some serious notes right now..LOL
Posted: Wed May 08, 2013 21:17 Post subject: Personal HOSTS.TXT files
Ok Pamela, hope you finally got it working!
I decided to upload 2 personal hosts list.
List-1 is a small list of hosts of the most famous trackers and information thieves operating in internet now, some of then are:
- Facebook
- Google (Gmail, Youtube, Android...)
- Yahoo
- Microsoft
- others...
They all have dedicated servers about getting personal information about us as statitics, they move lot of money only by tracking what we are doing on internet.
So List-1 is a personal investigation on my personal internet usage on a research for seeying what are the most used DNS url's while browsing, you can do this by using OpenDNS.com and watching wich domains your router visited. Lot of this domains are those trackers.
Microsoft.txt is a Microsoft dedicated list in case of you dont want to allow any contact with microsoft servers done by your Windows OS automatically, for example:
- Always you got internet conection on your PC (through www.msftncsi.com)
- Every day you have a scan on your computer for updates (even if you disabled the service!) and they always look for piratery!
(note: using Microsoft.txt on your hosts.txt file wont allow your windows to update)
I will try to maintain List-1 updated here.
dont hessitate to make any sugestion for this list.
Thank you so very much for the files!
I still am looking at how to upload these files to the router.
Again I very much appreciate your time.
T.I.A.
Pamela
To upload the files to the router you need to enable JFFS2 and SSH as i explain in the post.
After, you will need a SCP client, as you use MAC you should try to use: http://www.rbrowser.com/
When installed, try to connect to your router with their ip (192.168.1.1) login name is "root" and password is your current router password. Remember to specify you want a SCP (or SSH) connection.
Once you get the router filesystem, search for the /jffs directory and copy there your "hosts.txt" file.