Tomato periodically starts using secondary DNS

Discussion in 'Tomato Firmware' started by Morac, Aug 12, 2009.

  1. Morac

    Morac Network Guru Member

    I have a WRT54GLv1 with Tomato 1.25 on it. Tomato is set to "Use internal caching DNS forwarder" on the Advanced DNS/DHCP page, but everything else is disabled on that page.

    I'm noticing that every now and then tomato starts using my secondary DNS exclusively. I can get tomato to start using my primary DNS by either renewing my DHCP lease from my ISP by clicking the renew button on the overview page or by clicking the save button on the Advanced DNS/DHCP page (which I believe restarts Dnsmasq).

    I thought that the secondary DNS should only be used if the primary DNS goes down, but the primary DNS is still up when this occurs. Also the /etc/dnsmasq.conf still lists the primary DNS as being first.

    My question is why is tomato doing this?
  2. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    This is a feature in Dnsmasq where it tries to use the DNS server that h as the best performance. If you want to use them in the given order only (and go to the secondary one only when the primary is down), add
    to your "Advanced"->"DHCP / DNS"->"Dnsmasq Custom Configuration".
  3. Morac

    Morac Network Guru Member

    Thanks for the info.

    How does Dnsmasq determine which has the "best performance"? Also do you know how often it checks?

    I checked the man page and it simply states "By default, dnsmasq will send queries to any of the upstream servers it knows about and tries to favour servers that are known to be up."

    The primary DNS should always have the best performance since it's a few hundred miles closer to me than the secondary DNS. The primary DNS is in Philadelphia, PA, while the secondary DNS is in Pittsburgh, PA. I'm about 15 miles from Philly.
  4. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    I don't know the specifics, but from my testing a while back, it seemed that on the first DNS request, Dnsmasq tried all of the servers, and decided to use (from then on) the first one that responded. I assume it would reevaluate that position if the "chosen" DNS server were to fail on a respond on a request.
  5. Morac

    Morac Network Guru Member

    Well that's definitely not desired in my case, so I'll just add the "strict-order".

    Personally I think that should be the default setting since the way Dnsmasq current works isn't standard.

    Thanks again.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice