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 to

    ¿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:


    and save these settings. In consequence, will be
    redirected to (which is in fact
  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

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

    mstombs Network Guru Member

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

    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

    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 "" --dport 80 -j DNAT --to-destination
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice