1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

DNSMasq overrides that survive firmware updates?

Discussion in 'ASUSWRT - Official' started by thespooler, Nov 7, 2018.

  1. thespooler

    thespooler New Around Here

    Joined:
    Nov 7, 2018
    Messages:
    3
    I'm trying to using the DHCP features on a 68U, but regardless of what you enter in the DNS settings, it will always add 0.0.0.0 to /tmp/etc/dnsmasq.conf which DNSMasq will change to the router IP. When a client gets a lease, DNS is now set to my desired DNS server, but also to the router. In my scenario, the router does not have internet access, instead of bridging the modem, I just have it plugged into the LAN port (I need the modem and PPPOE diagnostics available).

    I've manually changed dnsmasq.conf so it survives a reboot, but not sure if the GUI might rewrite this file when other settings change. I don't know anything about embedded linux but I imagine somewhere the daemon is getting started and I might be able to change the command line for it to force the -dhcp-option.

    For surviving firmware updates, maybe there's a script that could run off the USB key in the back of the router? Hopefully it runs before DHCP leases are provided?

    In the mean time, I've was manually setting DNS on the clients but for now I've gone back to DHCP on the modem.
     
  2. Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!
  3. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    28,266
    Location:
    Canada
    Config files are dynamically generated by the router, you cannot modify them, and any change will be lost whenever the service is restarted or the router is rebooted.
     
  4. thespooler

    thespooler New Around Here

    Joined:
    Nov 7, 2018
    Messages:
    3
    Thank you for letting me know. I'm now trying a "asusware/.asusrouter" script on a fat32 usb drive, but I can't tell if it's executing or not. I tried to write to /tmp but I don't see anything. The drive is mounting, and if I run the script manually it works as expected, but doesn't appear to auto run or perhaps /tmp is not available at that time. Not sure...
     
  5. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    28,266
    Location:
    Canada
    That won't work. Whenever dnsmasq gets restarted, it will overwrite any change that script would have made.
     
  6. thespooler

    thespooler New Around Here

    Joined:
    Nov 7, 2018
    Messages:
    3
    If I kill and launch dnsmasq with the change I want to make on command line, it could win over the identical setting in the .conf file. I wasn't able to google which would take priority.
     
  7. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    6,757
    Location:
    UK
    That would work up until the point where the router restarts dnsmasq, as noted by RMerlin. Not only is dnsmasq restarted a few times on startup but also later on. Applying changes to many of the options in the router's GUI would initiate such a restart.
     
  8. bbunge

    bbunge Very Senior Member

    Joined:
    Aug 11, 2014
    Messages:
    601
    Location:
    Pennsylvania USA
    You are hinting about running a script from a USB on router start with stock Asus. Yes, it is possible and I believe I did a post on that topic to start a swap file if you search for it.

    Sent from my SM-T380 using Tapatalk
     
Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!