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
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
R3) As an added safety measure; how can I check that
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
Thanks...
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; thena) 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: