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

Persisting changes to /tmp/hosts and /tmp/dsnmasq.conf files

Discussion in 'DD-WRT Firmware' started by will792, Dec 23, 2005.

  1. will792

    will792 Network Guru Member

    How can I persist changes to /tmp/hosts and /tmp/dsnmasq.conf files between reboots? Apparently these files are recreated on each reboot.

    I looked at all nvram variables but nothing looks right.

    I use v.22r2 if it makes any difference.


    P.S. If I use echo command in rc_startup the files are modified but apparently DNSMasq starts before rc_startup so the changes are not used in running instance.
  2. mowfax

    mowfax Network Guru Member

    I have exactly the same problem, but I use the latest firmware from 23.12.

    Come on, someone surely has a clue how to do this :poke:
  3. will792

    will792 Network Guru Member

    Actually I found a solution that works for me. It is not perfect though.

    The additions to /tmp/dnsmasq.conf are simple, just use data that you want to add to "Additional DNS Options" texbox in DNSMasq area. I added:
    The changes to hosts are more challenging. I had to use echo command in rc_startup. Somehow I have one extra line in hosts file after each nvram commit. The dd-wrt executes .rc_startup every time settings are saved. I expected it to happen once only, on boot.

    I did the following from SSH/Telnet:

    nvram set rc_startup="
    /bin/echo ' name_I_want_to_block' >> /tmp/hosts
    nvram commit

Share This Page