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

How to clear dnsmasq cache?

Discussion in 'Tomato Firmware' started by Assman, Aug 20, 2009.

  1. Assman

    Assman Addicted to LI Member

    Hey everyone,

    What's the most practical way to clear dnsmasq cache. How do I configure dnsmasq to remember entries for a fixed period of time, than flush everything and start fresh?
  2. phuque99

    phuque99 LI Guru Member

    It does that automatically, via DNS TTL.
  3. Assman

    Assman Addicted to LI Member

    And what's the default ttl?
  4. phuque99

    phuque99 LI Guru Member

    There's no such thing called default TTL. The TTL is always issued by the host name's nameserver and is passed on to any DNS server that queries it. Entries are cached for the duration of the TTL. DNSmasq will cache them for the duration of the TTL.
  5. Assman

    Assman Addicted to LI Member

    I see. Thank you :thumbup:
  6. fyellin

    fyellin LI Guru Member

    If you're really serious about clearing your cache, "service dnsmasq restart" will shutdown dnsmasq and then restart it.

    I'm not sure why you'd want to do this, though.
  7. Assman

    Assman Addicted to LI Member

    One more question. Since I'm using dnsmasq cache, should I disable windows and browser caching?
  8. Assman

    Assman Addicted to LI Member

    Anyone :help:?
  9. ntest7

    ntest7 Network Guru Member


    The DNS cache takes care of itself. You should rarely need to clear it, and never need to disable it.

    DNS caching is a well-established feature built into the DNS protocol, with built-in time limits defined by the domain you're trying to look up. This is nothing like a web cache.

    Google for "dns caching" for more info.
  10. Assman

    Assman Addicted to LI Member

    Thank you all for help :thumbup:
  11. kylejustknows

    kylejustknows Reformed Router Member

    well I meet this issue as well.

    the situation is:

    1, Tomato is set using "google dns"
    2, I changed my webserver www.mywebsite.com to a new IP address on the nameserver.
    3, 10 mins later, google DNS server already updated to new IP address (checked via multiple 3rd party online tools, all google dns servers and my local dns servers are all updated to new ip address already)
    4, But visiting or ping the website.com on my PC, it still direct to old IP address, even using the "ipconfig /flushdns" to clear the dns cache on my own PC
    5, Find out that tomato is strictly follow the DNS TTL (it was very long, 24 hours). It simply won't re-check the dns no matter what, until 24 hours later. I can not wait that long and waste all day of time.

    Need a way to clear the dns cache in tomato, thats why.
  12. Techie007

    Techie007 Serious Server Member

    Been there several times myself. Log in to your router's config page, and execute the following command in the Tools -> System Commands section:
    service dnsmasq restart
    And then open an administrative command prompt on your PC and execute the following command:
    ipconfig /flushdns
  13. Sean B.

    Sean B. LI Guru Member


    In the custom config box of Advanced->DHCP/DNS.


Share This Page