What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

How to "redirect" requests to a certain IP to a different DNS. RT-N66U

u6f6o

New Around Here
Hi,

I am currently checking the pre-conditions to flash asuswrt-merlin on my RT-N66U router. One of my main points is to have kind of address translation service in place. Particularly I want to redirect a certain request that points towards a certain DNS (Google DNS servers in this case) to an alternative DNS server.

Is it possible to do so with the asuswrt-merlin firmware?

Thx in advance.
 
As I found here https://github.com/RMerl/asuswrt-merlin/wiki/Iptables-tips, one can add additional IPtables rules. So basically, I could take the requests that are intended to go towards 8.8.8.8, 8.8.4.4. (google dns, chromecast) and redirect it to my own dns servers as I understand?

If your need are specifically for DNS redirection, then you won't even need to mess with IPtables - just use DNSFilter.

dnsfilter_sm.png


https://github.com/RMerl/asuswrt-merlin/blob/master/README-merlin.txt#L551

http://asuswrt.lostrealm.ca/sites/default/files/pictures/dnsfilter.png
 
Thx for the quick answer. I tried it out and it worked. The only thing is, I basically set it for the whole device (in this case chromecast) instead of simply applying it for a given destination IP, right?

As you might have assumed what I want to achieve is to simply use a foreign dns for certain services and stick with the default dns for everything else.
 
Thx for the quick answer. I tried it out and it worked. The only thing is, I basically set it for the whole device (in this case chromecast) instead of simply applying it for a given destination IP, right?

As you might have assumed what I want to achieve is to simply use a foreign dns for certain services and stick with the default dns for everything else.

Yes, if you use RMerlin's solution, then it applies to all DNS requests coming from the device. This will fix your problem (you'll be able to access the geoblocked service) but may not be something that you want if you care about your privacy.

If you only want to redirect SOME requests then you'll probably have to use dnsmasq or similar.

See my solution which doesn't use DNSFilter and only redirects some requests to an alternative DNS provider: Re-routing Google's DNS
 
Yes, if you use RMerlin's solution, then it applies to all DNS requests coming from the device. This will fix your problem (you'll be able to access the geoblocked service) but may not be something that you want if you care about your privacy.

If you only want to redirect SOME requests then you'll probably have to use dnsmasq or similar.

See my solution which doesn't use DNSFilter and only redirects some requests to an alternative DNS provider: Re-routing Google's DNS

Thx for the link! I found this one as well https://gist.github.com/u6f6o/85354f2eaba6bee8d884
 
Okay, here is what I did at the end:
  1. Flash router with asuswrt-merlin
  2. Enable jffs (in general was enabled but not the option to execute user defined configs/scripts)
  3. Enable ssh login
  4. Login to the router, IP was 192.168.1.1 as default and port 22 with ssh
  5. Tell router to use your desired DNS servers for netflix.com, other traffic goes through default DNS
    cat /jffs/configs/dnsmasq.conf.add <<EOF
    server=/netflix.com/<YOUR_DNS_SERVER_1>
    server=/netflix.com/<YOUR_DNS_SERVER_2>
    EOF
  6. Use a DNSFilter under parental control section to redirect whole DNS stuff from chromecast to the desired DNS server, thus:
    Enable DNS filtering: ON
    Global filtering mode: No filtering
    Custom (user-defined) DNS1: <YOUR_DNS_SERVER_1>
    Client name: <YOUR_CHROMECASTS_NAME>
    Client MAC address: automatically filled out
    Filter Mode: Custom 1
  7. Apply changes and restart router
What I realized as well. My chromecast had a country configuration "Germany". At the end I changed it to "United Stated". Don't know if this is really necessary, but could be a good hint in case sth. is not working.

Many thanks for the help, Merlin and Mozilla!
 
Merlin

what if I want to forward all request from port 53 to port 5353 some ip addresss. from parental control it's not possible for me to add port

THanks.

No, DNSFilter does not support changing the port.
 
Currently i use dnsmasq and redirect to server#5353
My ISP block any changes in the dns
And I need unotelly dns.

I also try using dnscrypt + dnsmasq and it also works but didnt have the capacity like unotelly smart dns

Any idea apart from dnsmasq

I try iptables but no luck. The traffic coulnt be forwarded
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top