What's new

IPTables for DNS redirection

  • 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!

Shrmn

Occasional Visitor
Hi guys,

I'm trying to set up a set of iptables rules to redirect Google Public DNS Servers to another set of DNS servers as the Chromecast has Google's IP Addresses hardcoded in the device.

I have the Chromecast's IP Address static on 192.168.1.123 and am attempting to reroute all DNS requests originating from the Chromecast to 8.8.8.8 and 8.8.4.4 to end up to a DNS server 1.2.3.4 (for privacy's sake) instead. I have them set up under jffs firewall-start but they don't seem to work:

iptables -I PREROUTING -t nat -p udp -s 192.168.1.123 -d 8.8.8.8 --dport 53 -j DNAT --to-destination 1.2.3.4
iptables -I PREROUTING -t nat -p udp -s 192.168.1.123 -d 8.8.4.4 --dport 53 -j DNAT --to-destination 1.2.3.4


SSH-ing directly into the router and keying in the above line gives me this:
iptables v1.4.14: multiple -p flags not allowed

I've tried --protocol and uppercased UDP as well and they still produce the same message. I'm lost.


Would anyone please help me out?

Cheers!
 
Use DNSFilter, on the Chromecast's MAC address.
 
Use DNSFilter, on the Chromecast's MAC address.

Sorry, I'm unsure on how I would go about using such a tool. The dnsfilter command via SSH tells me its not found and I can't seem to find such an option on the Web GUI (I'm using your latest build on an AC68U)
 
And also read the documentation that came with the firmware.
 

Latest threads

Sign Up For SNBForums Daily Digest

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