Adjusting Pi-hole v6 Session Timeout and MAXSESSIONS Setting.
This is the Fourteenth in a series of posts, featuring Protips, tips, tricks, hacks, and secrets provided by Our Team 🙊 — We want to share our top tips for the growing and thriving Linux community out there. Because sometimes you need a little help...

Pi-hole v6 has a built-in session timeout, known as webserver.session
for its web interface. By default, this is set to 1800 seconds, which means you'll be logged out after 30 minutes of inactivity. While this enhances security, it can be frustrating for frequent users. Additionally, the MAXSESSIONS
setting in pihole-FTL.conf
controls the maximum number of concurrent DNS queries, not web sessions.
This guide will show you how to adjust these settings for better usability.
Increasing Web Session Timeout in pihole.toml
The session timeout setting is located in the following file:
/etc/pihole/pihole.toml
By default, the timeout is:
[webserver.session]
timeout = 1800
This means that if you are inactive for 30 minutes, the web interface will log you out automatically.
Change the Timeout:
- Open the file in your favorite text editor:
$ sudo nano /etc/pihole/pihole.toml
- Change the
timeout
value to3600
(or any preferred duration):
[webserver.session]
timeout = 3600
Now, your session will remain active for 60 minutes instead of the default 30 minutes.
- Restart Pi-hole to apply the changes:
$ sudo systemctl restart pihole-FTL
What Does MAXSESSIONS
actually Do?
The MAXSESSIONS
setting in Pi-hole's pihole-FTL.conf
controls the maximum number of DNS queries that can be processed simultaneously by the Pi-hole DNS resolver (FTL).
This does not refer to how many users can be logged into the Pi-hole web interface at the same time. Instead, it limits the number of active DNS requests that Pi-hole can handle at once, meaning that if too many queries exceed this limit, some DNS requests may be delayed or dropped, affecting network performance.
For instance:
- If
MAXSESSIONS=150
(default), Pi-hole can process up to 150 simultaneous DNS queries at any moment. - If your network has a high volume of DNS requests, increasing this number (e.g.,
MAXSESSIONS=300
) may help avoid bottlenecks.
However, setting it too high can use more system memory, so it's best to adjust it based on network demand.
Adjusting MAXSESSIONS
in pihole-FTL.conf
- Open the file in your favorite text editor:
$ sudo nano /etc/pihole/pihole-FTL.conf
- Find (or add) the following line:
MAXSESSIONS=300 # Adjust this as needed
This means Pi-hole will handle up to 300 concurrent DNS queries simultaneously. If the number of incoming requests exceeds this limit, additional queries will be queued and must wait until Pi-hole has processed some of the existing ones. Depending on your network's traffic load and the number of connected devices, you may need to adjust this value for optimal performance. Increasing the setting is ideal for high-traffic networks or environments with many devices, as it enables Pi-hole to handle more requests simultaneously. On the other hand, lowering the value can help improve performance in networks with lighter demand by limiting the number of active queries.
- Restart Pi-hole:
$ sudo systemctl restart pihole-FTL
- Verify Change:
You can verify if the setting has been applied correctly by checking the Pi-hole logs or using the Pi-hole web interface to monitor its performance. If you're uncertain, you can also run the command below, which will generate a debug log that can help you confirm whether the settings are correct.
$ sudo pihole -d
Then, observe Pi-hole's performance over time. If you notice issues like DNS requests being queued or slow responses, consider adjusting the MAXSESSIONS
value again to better align with your network's demands.
These changes will help keep your Pi-hole web session active longer and ensure your network handles more simultaneous DNS queries efficiently.
However, always balance usability with security—longer session times and higher DNS query limits could pose a risk if misconfigured.
We hope this was of great use!
Happy tweaking! 🚀