decedion
Occasional Visitor
I have followed the guide in Blocking ADs with MVPS Host File but it doesn't work for me.
I have done the "Improve Your Web Surfing Speed with OpenDNS" how-to too.
And then I have added:
The wan-script is this:
But it only works in router!
I have tested with this url.
In router:
In my PC:
The dig's output:

Any idea? Thanks
I have done the "Improve Your Web Surfing Speed with OpenDNS" how-to too.
And then I have added:
Code:
wget -qO- http://winhelp2002.mvps.org/hosts.txt | grep -w ^0.0.0.0 | sed $'s/\r$//' | sort -u >> /etc/hosts
The wan-script is this:
Code:
#!/bin/sh
# Wait up to 15 seconds to make sure /opt partition is mounted
i=0
while [ $i -le 15 ]
do
if [ -d /opt/tmp ]
then
break
fi
sleep 1
i=`expr $i + 1`
done
# Now resolve DNS name for NTP server
ntp_name=$(nvram get ntp_server0)
grep "$ntp_name" /etc/hosts > /dev/null 2>&1 || \
for ip in $(/opt/sbin/dnscrypt-proxy-hostip $ntp_name)
do
echo $ip $ntp_name >> /etc/hosts
done
wget -qO- http://winhelp2002.mvps.org/hosts.txt | grep -w ^0.0.0.0 | sed $'s/\r$//' | sort -u >> /etc/hosts
# and restart NTP client to eliminate 4-5 mins delay
killall ntp && sleep 1
service restart_ntpc
But it only works in router!

I have tested with this url.
In router:
Code:
# ping -c 3 fr.a2dfp.net
PING fr.a2dfp.net (0.0.0.0): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.396 ms
64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.255 ms
64 bytes from 127.0.0.1: seq=2 ttl=64 time=0.243 ms
--- fr.a2dfp.net ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.243/0.298/0.396 ms
In my PC:
Code:
$ ping -c 3 fr.a2dfp.net
PING fr.a2dfp.net (85.116.37.142) 56(84) bytes of data.
64 bytes from 85.116.37.142: icmp_seq=1 ttl=51 time=48.5 ms
64 bytes from 85.116.37.142: icmp_seq=2 ttl=52 time=42.9 ms
64 bytes from 85.116.37.142: icmp_seq=3 ttl=52 time=44.4 ms
--- fr.a2dfp.net ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 10197ms
rtt min/avg/max/mdev = 42.953/45.320/48.585/2.391 ms
The dig's output:
Code:
$ dig fr.a2dfp.net
; <<>> DiG 9.9.3-rpz2+rl.13214.22-P2-Ubuntu-1:9.9.3.dfsg.P2-4ubuntu1.1 <<>> fr.a2dfp.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24073
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;fr.a2dfp.net. IN A
;; ANSWER SECTION:
fr.a2dfp.net. 103 IN A 85.116.37.142
;; Query time: 0 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Fri Mar 07 21:49:29 CET 2014
;; MSG SIZE rcvd: 46


Any idea? Thanks