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!

Custom DNS records on RT-AC86U stock FW 3.0.0.4.386_51955

azimuth

New Around Here
I wonder if it's possible to use the built-in dnsmasq on the stock FW to add custom DNS records. I have edited /etc/dnsmasq.conf and added address=/<domain>/<IP address> records but my edits are overwritten on restart of dnsmasq or router. Has anyone achived this? I have checked the output of nvram show to see if I could figure out any variable to set using the nvram set command but there seems to be nothing suitable. So, all in all, is this possible on the stock FW?
 
No, there isn’t an easy way to customize on stock FW. Merlin FW would be the obvious solution.
 
I believe you'd need the ability to run a script after every restart, which I don't believe is possible on stock firmware. The other option would be to run a local DNS server on another device. But it's less hassle to just use Merlin, unless you have some unusual requirement!
 
If the router has an USB port and support Download Master then it's doable on stock firmware: https://github.com/jacklul/asuswrt-scripts
custom-configs + service-event scripts should let you achieve what you want

Not sure if this will work for AC line of products, possibly there are going to be some minor issues with the old BusyBox, I remember one user reported that "readonly" is not supported on their device's - so you will have to fix the script manually.
 
If the router has an USB port and support Download Master
I guess it does support Download Master. I will try that, thanks.
1744029090197.png
 
If the router has an USB port and support Download Master then it's doable on stock firmware: https://github.com/jacklul/asuswrt-scripts
I'm stuck here. I have tried to follow the instructions there. It seems that my router needs the workaround to be able to run scripts using script_usbmount. I have tried to follow the instructions for workaround but can't get it to work. What confuses me is that none of the files listed on the page exist on my router:
  • command in script_usbmount NVRAM variable
  • /jffs/scripts/usb-mount-script script
  • /jffs/scripts/scripts-startup.sh script
  • /jffs/scripts-startup.sh script
Anyone can confirm that the workaround actually works?
 
If I go for switching to Merlin FW, can I leave my other router which is mesh node on stock FW? Or should both routers run Merlin FW?
 
I'm stuck here. I have tried to follow the instructions there. It seems that my router needs the workaround to be able to run scripts using script_usbmount. I have tried to follow the instructions for workaround but can't get it to work. What confuses me is that none of the files listed on the page exist on my router:

Anyone can confirm that the workaround actually works?
You have to install the startup script: https://github.com/jacklul/asuswrt-...-these-commands-to-install-the-startup-script
 
When you run Merlin on the main router, there's no reason or need to run it on APs or Mesh nodes - so not doing so it not only normal, but the right thing to do!
 
OK. There was no folder /jffs/scripts but I have created it. Then when I run the commands on the page you linked, I get this output:
Setting NVRAM variable 'script_usbmount' to '/bin/sh /jffs/scripts/scripts-startup.sh start'
Waiting for 15 seconds to verify that the value is still set...
Value has been cleaned by the router - you will have to use a workaround:
I have already a USB stick attached with the files from the workaround page. Not sure what else I should do.
 
I have already a USB stick attached with the files from the workaround page. Not sure what else I should do.
There should be a log entry ("starting custom scripts") upon plugging in the USB storage for the first time since boot. To do a clean test you should either reboot the router or replug the storage device.
 
Apr 7 16:03:27 S50usb-mount-script.1: Executing command: /jffs/scripts/scripts-startup.sh start
Apr 7 16:03:27 rc_service: hotplug 21304:notify_rc restart_nasapps
Apr 7 16:03:27 iTunes: daemon is stoped
Apr 7 16:03:27 FTP Server: daemon is stopped
Apr 7 16:03:27 Samba Server: smb daemon is stoped
Apr 7 16:03:29 kernel: DROP IN=eth0 OUT= MAC=24:4b:fe:e6:38:78:00:08:ae:8c:ce:e0:08:00 SRC=194.180.48.144 DST=37.123.149.252 LEN=40 TOS=0x00 PREC=0x00 TTL=240 ID=778 PROTO=TCP SPT=59504 DPT=727 SEQ=1428853793 ACK=0 WINDOW=1024 RES=0x00 SYN URGP=0 MARK=0x8000000
Apr 7 16:03:29 Timemachine: daemon is stoped
Apr 7 16:03:29 miniupnpd[21245]: shutting down MiniUPnPd
Apr 7 16:03:29 avahi-daemon[21557]: WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Apr 7 16:03:29 Samba Server: daemon is started
Something seems to be happening when I attach the USB with the workaround but I still get the error "Value has been cleaned by the router - you will have to use a workaround".
 
Something seems to be happening when I attach the USB with the workaround but I still get the error "Value has been cleaned by the router - you will have to use a workaround".
The workaround is the alternative to using that nvram variable, the installer tells you to use the workaround, which you do, nothing more to think about here.

From the log it does seem to be working so you can proceed with installing mentioned scripts and configuring.

Edit:
Sample /jffs/configs/dnsmasq.conf.add:
Code:
address=/home.lan/192.168.1.251
address=/test.lan/192.168.1.251
 
Last edited:
OK. And how do I proceed? I have installed custom-configs.sh, created /jffs/configs/dnsmasq.conf.add with my additions, I reinsert the USB drive but it doesn't seem to work 🤔

UPD: I got it to work but still the domains are not resolved from my mobile devices. Although, when I try nslookup <my custom domain> 192.168.1.1 on my PC, it works fine.

UPD2: It works now! 🙂
 
Last edited:
I reinsert the USB drive but it doesn't seem to work 🤔
Btw scripts-startup can only be triggered once per boot to prevent scripts from starting multiple times

Glad you got it working!
 

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