No, AdGuard Home does not currently support a native prefetch feature like Unbound’s prefetch option. The software relies on standard caching mechanisms where records are stored only after a client requests them. This means popular domains are not preemptively loaded into the cache to reduce initial latency for new queries.
Understanding AdGuard Home Caching Behavior
AdGuard Home manages DNS traffic by intercepting queries and checking its local database before forwarding requests to upstream resolvers. When a device asks for an IP address, the system looks for that record in its memory. If found, it returns the cached value immediately. If not, it performs the lookup, caches the result, and then serves it to the client. This process ensures consistency but introduces a slight delay for the first request to any given domain.
The absence of prefetching is a known limitation compared to more advanced resolvers like Unbound or BIND. Those tools can monitor network traffic or use statistical models to predict which domains will be queried next and fetch their records in advance. AdGuard Home focuses on simplicity and privacy rather than aggressive pre-loading. It prioritizes blocking unwanted traffic and logging over optimizing cache hit rates through prediction.
Workarounds for Improved Performance
While you cannot enable prefetch directly, there are several strategies to mitigate the impact of cold caches. First, ensure your hardware has sufficient RAM. AdGuard Home stores all active cache entries in memory. A larger cache size allows more records to persist, reducing the need to re-fetch them frequently. You can adjust the cache size in the settings under
DNS >
Caching. Increasing this value helps keep popular sites available even after short periods of inactivity.
Second, consider using a secondary resolver with prefetch capabilities as an upstream server. For example, you can configure AdGuard Home to forward queries to Unbound instead of Cloudflare or Google DNS. Unbound will handle the prefetching logic, and AdGuard Home will benefit from the pre-cached responses. This setup adds complexity but provides the performance benefits of prefetching without requiring native support in AdGuard Home.
Third, optimize your client devices. Modern operating systems often implement their own DNS caching layers. Windows, macOS, and Linux distributions maintain local caches that store recent lookups. Ensuring these local caches are healthy reduces the frequency of queries sent to AdGuard Home. Additionally, using browser-specific features like HTTP/3 or QUIC can sometimes bypass traditional DNS lookups for known services, further reducing load on your DNS server.
Configuring a Custom DNS Server for WireGuard VPN Clients shows how integrating different DNS solutions can enhance overall network efficiency. By combining AdGuard Home with other optimized resolvers, you can create a hybrid environment that balances privacy with performance.
Adjusting Cache Settings
To maximize the effectiveness of the existing cache, review the TTL (Time To Live) policies. AdGuard Home respects the TTL values provided by upstream servers. However, you can influence behavior by selecting upstreams that provide stable and reasonable TTLs. Avoid resolvers that issue very short TTLs, as this forces frequent refreshes and increases the chance of cache misses. Cloudflare and Google typically provide reliable TTLs that work well with AdGuard Home’s caching strategy.
Comparing With Other Resolvers
Unbound stands out for its prefetch capability, which actively monitors query patterns to preload likely candidates. This feature is particularly useful in high-traffic environments where every millisecond counts. AdGuard Home lacks this specific algorithmic approach. Instead, it relies on a straightforward least-recently-used (LRU) eviction policy when the cache reaches its limit. This difference highlights the trade-off between simplicity and advanced optimization.
If prefetching is critical for your use case, migrating to Unbound might be necessary. However, AdGuard Home offers unique advantages in terms of user interface, filtering capabilities, and ease of deployment. Many users find that the slight latency increase from missing prefetch is negligible compared to the benefits of easy ad blocking and detailed analytics.
Troubleshooting DNS Wildcard Domains: github.com Case Study illustrates how complex DNS configurations can affect resolution times. Understanding these interactions helps in tuning your DNS infrastructure regardless of whether you use prefetch or standard caching.
Future Development Possibilities
The AdGuard Home community frequently discusses potential features. Prefetching has been mentioned in various forums and GitHub issues as a desired enhancement. While no official timeline exists, the development team may consider implementing similar functionality in future releases. Keeping your software updated ensures you get the latest optimizations and bug fixes that improve caching efficiency.
Monitoring your logs can provide insights into cache performance. Look for patterns where certain domains are consistently requested but rarely found in the cache. These "cold" domains might benefit from manual intervention or upstream changes. Over time, as your network usage stabilizes, the cache will naturally warm up, reducing the reliance on prefetch mechanisms.
Frequently Asked Questions
Does AdGuard Home block prefetch requests?
No, AdGuard Home does not block prefetch requests because it does not generate them itself. It only responds to queries initiated by clients or configured upstream resolvers. Any prefetching must come from the upstream server, such as Unbound, if that feature is enabled there.
Can I manually add domains to the cache?
Currently, there is no direct API or UI option to inject specific records into the AdGuard Home cache. You must rely on actual DNS queries to populate the cache. Some users simulate queries by pinging domains or loading websites to trigger lookups, effectively warming the cache manually.
How does cache size affect performance?
A larger cache size allows AdGuard Home to retain more records, reducing the frequency of external lookups. However, increasing it too much may consume excessive RAM on low-end devices. Find a balance that fits your hardware while keeping enough space for your most visited sites.
Is Unbound better than AdGuard Home for caching?
Unbound excels at advanced caching features like prefetching and recursion optimization. AdGuard Home focuses more on filtering, logging, and ease of use. If caching performance is your primary goal, Unbound is superior. If you need ad blocking and control, AdGuard Home is the better choice.
What happens if the cache is full?
When the cache reaches its maximum capacity, AdGuard Home uses an LRU policy to remove the least recently used entries. New queries will trigger fresh lookups until the removed records are needed again. This ensures that the most active domains remain accessible while older, unused records are discarded.