The location of the DNS cache file for AdGuard Home can vary depending on the operating system and installation method you're using. By default, AdGuard Home stores its cache in a file called "querylog.db" within its data directory.As the title reads, where is the DNS cache file for AdGuard Home located?
/opt/etc/AdGuardHome/data/querylog.db
/opt/etc/AdGuardHome/data/querylog.db
Keeps a record of all requests made and not just the specified requests in the query log. Actually disabling the cache does not disable the query log since both features are dynamically different.Ahaa ok. Yeah i have seen that file around, but i thought it was for.. query logs!The location of the DNS cache file for AdGuard Home can vary depending on the operating system and installation method you're using. By default, AdGuard Home stores its cache in a file called "querylog.db" within its data directory.
Here are the default locations for the AdGuard Home data directory on different operating systems:
Please note that these paths may vary if you have customized the installation or if you're using a different operating system.
- Linux: /opt/adguardhome/data/
- Windows: C:\ProgramData\AdGuardHome\data\
- macOS: /Applications/AdGuardHome/AdGuardHome.app/Contents/data/
Within the data directory, you should find the "querylog.db" file, which contains the DNS cache information.
For the asuswrt-merlin addon, the location would be/opt/etc/AdGuardHome/data/querylog.db
HTH
This sounds like an answer from ChatGPTThe location of the DNS cache file for AdGuard Home can vary depending on the operating system and installation method you're using. By default, AdGuard Home stores its cache in a file called "querylog.db" within its data directory.
Here are the default locations for the AdGuard Home data directory on different operating systems:
Please note that these paths may vary if you have customized the installation or if you're using a different operating system.
- Linux: /opt/adguardhome/data/
- Windows: C:\ProgramData\AdGuardHome\data\
- macOS: /Applications/AdGuardHome/AdGuardHome.app/Contents/data/
Within the data directory, you should find the "querylog.db" file, which contains the DNS cache information.
That's a useful human answerFor the asuswrt-merlin addon, the location would be/opt/etc/AdGuardHome/data/querylog.db
They are both actually better than my first thought. My first answer was going to be @SomeWhereOverTheRainBow , just like the username reads.This sounds like an answer from ChatGPT
That's a useful human answer
The query logging feature and caching feature are independent of each other. Disabling query logging does not mean disable caching, and vice versa. The query logging feature in AdGuardHome allows you to log DNS queries made by clients, and you can choose to save the logs to a file or view them through the web interface. This feature provides you with visibility into the DNS traffic and can be helpful for troubleshooting or monitoring purposes. Disabling query logging means that AdGuardHome will no longer keep a record of the DNS queries. On the other hand, the caching feature in AdGuardHome is responsible for storing DNS responses for a certain period of time. When a client makes a DNS query, if the response is cached, AdGuardHome can serve the response from the cache instead of forwarding the request to the upstream DNS server. This caching mechanism helps improve performance by reducing the response time for frequently accessed DNS records. In the grand scheme of things, disabling query logging does not have any directly impact on the caching functionality of AdGuardHome. You can choose to enable or disable caching independently of query logging, or vice versa. As you probably already noticed, the cache config options, such as the cache size and duration separate settings in AdGuardHome's config than query logging. It just so happens, that both features share the same dataSo if querylogging is disabled (including querylog: file_enabled option) caching is disabled too?
querylog.db
where they both take up storage and consume more resources as they grow in size.I was thinking the same thing. It sounds very strange. But then I don't know anything at all about AdGuardHome.Why would they cache to disk, especially a potentially slow USB drive? Aren’t caches supposed to be in RAM?
What you are saying is correct. From my understanding the actual immediate cached response is not stored here, but a record of the cache responses is kept here for leveraging cache_optimistic mode and logging purposes, but I actually encourage the users with all these questions to visit the AdGuardHome for questioning the actual experts on the product as none of its experts are here answering questions on this forum (atleast none that openly announce themselves).Why would they cache to disk, especially a potentially slow USB drive? Aren’t caches supposed to be in RAM?
*Edit*
Some additional clarification about how AdGuardHome Cache responses. The DNS cache itself is stored in memory instead of actually being saved to a file. For you this means that there is no physical location the response is actually stored. The cache mechanics of AdGuardHome utilize program's memory space for storing cache responses. This allows it to store DNS responses for a certain specified duration of time. This cache is dynamically managed by AdGuardHome itself. AdGuardHome utilizes the LRU (Least Recently Used) caching algorithm, where older or less frequently accessed DNS responses are gradually evicted from the cache as new entries are added. This keeps the cache responses current. Upon restarting AdGuardHome, the cache is completely cleared. Also, cached entries cannot be manipulated outside of the AdGuardHome memory space since AdGuardHome manages the storing of cached entries in its memory./opt/etc/AdGuardHome/data/querylog.db
Keeps a record of all requests made and not just the specified requests in the query log. Actually disabling the cache does not disable the query log since both features are dynamically different.
Here is a general breakdown of how AdGuardHome allocates its memory resources to give you the overall picture.As the title reads, where is the DNS cache file for AdGuard Home located?
Ok nice! What are considered good TTL values? Especially for the kind of routers we use?Here is a general breakdown of how AdGuardHome allocates its memory resources to give you the overall picture.
- Memory Allocation: AdGuardHome dynamically allocates memory as needed to store data and perform its operations. It utilizes memory allocation mechanisms specified by its programming language (e.g. Go). AdGuardHome is able to adapt its memory usage based on the workload demands.
- Caching: AdGuardHome employs an in-memory cache to store DNS responses, as well as other frequently accessed data, such as blacklists, whitelists, and filtering rules. The cache is typically designed to be efficient and optimized for fast lookup and retrieval. AdGuardHome manages the cache size and evicts older or less frequently used entries to make room for new ones.
- Memory Efficiency: AdGuardHome leverages memory efficiently by optimizing data structures and minimizing unnecessary memory consumption. This includes techniques like using compact representations for data, avoiding duplication, and optimizing memory layout.
- Garbage Collection: AdGuardHome is built using a programming language that employs garbage collection (e.g. Go) which relies on the garbage collector to automatically reclaim memory that is no longer in use. The garbage collector identifies and frees memory that is no longer reachable by the program, thereby ensuring efficient memory utilization.
- Configuration Options: AdGuardHome often provides configuration options to adjust memory-related settings. This may include options to control cache size, TTL (time-to-live) for cached entries, and other memory-related parameters. These options allow users to fine-tune memory usage based on the available resources and specific requirements of their setup.
It is talking about the ttl of the dns request. The min ttl and max ttl option is adjustable on the adguardhome dns settings page right next to the optimistic caching option.Ok nice! What are considered good TTL values? Especially for the kind of routers we use?
Take the default number and divide it by four, that is as low as I would go without expecting compromise in performance.Ok nice!
Regarding the cache file, since it stores data in this .db file, it takes time to open this file on boot. Does it closes this file during normal operations? I assume it keeps it up in the ram during normal operations with writes to the .db file from time to time?
What is a sane value for cache size without getting a slow system? Both in cache being to small and adguard gotta fetch data from the outside world. And the cache size being to big to handle.
For me im using RT-AX86U with a usb connected ssd drive.
Thats like 1mb?Take the default number and divide it by four, that is as low as I would go without expecting compromise in performance.
That is okay. I set mine at 1mb. A typical cache doesn't need to more than 2 to 3 at most. Adguardhome just gives 4 as the default, but it can operate well at less. I operate at a lower value to reduce the amount of memory foot print.Thats like 1mb?
Mine is set to 50mb atm
Ah ok.That is okay. I set mine at 1mb. A typical cache doesn't need to more than 2 to 3 at most. Adguardhome just gives 4 as the default, but it can operate well at less. I operate at a lower value to reduce the amount of memory foot print.
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!