5

Firefox on a home Linux PC has some saved bookmarks.

Will Firefox ask the local DNS client to make DNS query when the user makes connections to the URLs from those bookmarks or the Firefox already has the resolved domain-names in its cache, so there will be no DNS query from the local DNS client to ISP's DNS server?

ccsann
  • 319
  • 1
  • 2
  • 11

2 Answers2

9

Firefox has an internal DNS cache, but it doesn't cache DNS query results beyond the TTL they indicated. Since usual A/AAAA record TTLs are in terms of hours or minutes, not months, the cache is only in-memory and not persisted with bookmarks or anywhere else – i.e. it behaves the same as your system resolver's cache.

Firefox will not ask the system resolver to make a query if it's configured to use DNS-over-HTTPS ("Trusted Recursive Resolver"), which is usually configured with a deliberately different server address than the system's, and for which it uses its internal stub resolver code.

grawity
  • 501,077
6

Bookmarks, in themselves, are only the URL, not the resolved IP address. E.G., for this query, https://superuser.com/questions/1864136/when-firefox-will-not-ask-the-local-dns-client-to-make-dns-query is the bookmark.

So the question is, under what conditions does Firefox open a site from the web, rather than using the cache?

  • Clearly, if a tab was recently opened, and then returned to after viewing another tab, the cached page is reused.

  • There is a setting for checking cached pages, set in about:config value browser.cache.check_doc_frequency.

    "This preference controls how often to check for a newer version of a cached page.

    0 - Check for a new version of a page once per session.

    1 - Check for a new version every time a page is loaded.

    2 - Never check for a new version - always load the page from cache.

    3 - Check for a new version when the page is out of date. (Default)"

  • There is a DNS cache timeout, which defaults to 60 seconds, plus a 60 second grace period, in Firefox 133.0. Older versions might have had a default of 300 seconds. Those settings are in about:config values network.dnsCacheExpiration and network.dnsCacheExpirationGracePeriod.

So this is not a definitive answer, and there are yet other timeouts that might interact with refreshing the DNS cache. One thing you might try is to temporarily disable DNS resolution (e.g., putting in 127.0.0.1 for DNS server) and see what happens when changing tabs, or after a wait.

You could also run a tool such as Sniffnet or Wireshark to see when Firefox makes a request to the DNS server.