What's new

Changing Port for upstream DNS Server

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

Alfsu

Regular Contributor
I've searched in this forum and on the web about this topic but, could not find clear explanation on how to accomplish this task, mainly due to my very limited knowledge on the subject.

The final goal is to set up an RT-AC68P router (384.14-2) to connect to the upstream dns servers using an alternate port (1512), servers which are already set in the WAN DNS setting page for both: DNS Server1 and DNS Server2; these servers also respond on port 53, but that port is being intercepted by the ISP.

How do I go about to instructing the Asus router to use the alternate port (1512) instead of port 53?

I did a successful test run on the alternative ports by way of running pihole on another device, but I am sure there is a better solution within the router itself.

Thank you in advance for your help!
 
I would do it by enabling JFFS scripts and custom configs in the GUI. Then create the file /jffs/scripts/dnsmasq.postconf with this content:
Code:
#!/bin/sh

CONFIG="$1"
. /usr/sbin/helper.sh

pc_delete "servers-file" "$CONFIG"
pc_append "server=1.1.1.1#1512" "$CONFIG"
pc_append "server=9.9.9.9#1512" "$CONFIG"
Replace 1.1.1.1 and 9.9.9.9 with the 2 DNS servers you actually want to use.

Refer to the wiki for the details of how these scripts work: https://github.com/RMerl/asuswrt-merlin/wiki/Custom-config-files
 
Thank you so much for your reply, I will give it a try!

Thanks again.
 
@dave14305 this is how it worked in the end:
Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh
pc_delete "servers-file" $CONFIG
pc_append "server=xxx.xxx.xxx.xxx#1512" $CONFIG
pc_append "server=xxx.xxx.xxx.xxx#1512" $CONFIG
logger "Changed to DNS Servers on port 1512"

Thank you for pointing me in the right direction.

Cheers!
 

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

Staff online

Top