What's new

[Help] DNS Forwarding, User scripts, Launching at startup

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

gspannu

Senior Member
Some help needed in creating scripts and firewall rules…

Requirement:
R1) I wish to run my own dnsproxy server at port 53535 (installed at /jiffs/dnsproxy/dnsproxy).
This is a opensource software available on Gthub known as dnsproxy. I have tested this on the Asus Router and it has been running successfully for over 36 hours.
The command to launch is
nohup /jiffs/dnsproxy/dnsproxy --listen 192.168.1.1 --port 53535 --upstream tls://dnsserver.mydomain.tld --fallback https://fallback.mydomain.tld &
What this does is it starts a DNS server (in background) listening on Router address at custom port 53535 and sends requests to upstream resolver(s) with fallback to a different resolver.

R2) If the above command launches successfully (pidof dnsproxy ? or something?) then redirect all default queries from port 53 to port 535353
iptables -t nat -I PREROUTING -i br0 -p udp -m udp --dport 53 -j REDIRECT --to-port 53535
iptables -t nat -I PREROUTING -i br0 -p tcp -m tcp --dport 53 -j REDIRECT --to-port 53535

R3) As an added safety measure; how can I check that dnsproxy is running; and if found that it is not running or has crashed; then
a) write a syslog event and
b) delete the above iptables rules (so that normal dnsmasq can continue to operate as is on port 53)
or relaunch dnsproxy and the rules again.

Help needed:
1) Where do I put all this code? In which scripts? nat-start? dnsmasq.postconf? firewall-start?
2) Are the iptables rules accurate or do I need to change anything? Do I also need to additionally put in iptables -t nat -A POSTROUTING -j MASQUERADE or do I need completely different rules?

Thanks...
 
Last edited:

Similar threads

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