1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Block and redirect

Discussion in 'Tomato Firmware' started by jofera, Mar 25, 2007.

  1. jofera

    jofera Guest

    Hi, first of all sorry for my worse english. I want to know how can I do for block a web address and redirect to another one. For ex. redirect www.xxx.com to www.google.es

    ¿It's possible to do it? Maybe I can moddificate some proxy file from the router to do it.

    Thank you very much.
     
  2. roadkill

    roadkill Super Moderator Staff Member Member

    maybe the Router/Local machine hosts file?
     
  3. Odin-60

    Odin-60 LI Guru Member

    You can redirect a host name to an arbitrary numerical IP address
    through an appropriate dnsmasq option. Open the page
    "Advanced/DCHP/DNS", enter -- for instance -- the following line
    into the "Custom Configuration" box:

    address=/www.xxx.com/209.85.135.99

    and save these settings. In consequence, www.xxx.com will be
    redirected to 209.85.135.99 (which is in fact www.google.es)
     
  4. GeeTek

    GeeTek Guest

    I enterd and saved that exact line, and it did not work. Is there a special combination of checkboxes necessary to make it function ?
     
  5. danix71

    danix71 LI Guru Member

    I'm interested too. I found this
    here.

    Could be instead of:
    address=/www.xxx.com/209.85.135.99
    be
    --address=/www.xxx.com/209.85.135.99 ?
    I don't know...
     
  6. mstombs

    mstombs Network Guru Member

    dnsmasq host redirection is working fine for adblocking - more info here:-

    http://www.linksysinfo.org/forums/showthread.php?t=54065

    but this uses a conf-file rather than directly entering into the web page.

    that's actually quite interesting - the conf file in the linked thread uses "--address" if the short form "-A" works it will make the conf-file significantly smaller!

    My 'static' jffs conf-file currently has 1973 entries similar to

    Code:
    address=/101com.com/127.0.0.1
    ...
    address=/zmedia.com/127.0.0.1
    
    Edit: the GUI form is a conf file, it needs the longer "address=" style. If you try and it doesn't appear to work from a PC - both your OS and browser's have DNS caches which need to be cleared.
     
  7. mikester

    mikester Network Guru Member

    You can also do this with iptables - insert under firewall scripts

    iptables -t nat -A PREROUTING -p tcp -d "xxx.com" --dport 80 -j DNAT --to-destination xxx.xxx.xxx.xxx
     

Share This Page