Pi-hole Bedtime Internet Shutoff: How to Set It Up
Yes, you can use Pi-hole to shut off internet access at bedtime, but it works by blocking DNS queries rather than physically disconnecting devices. You set a schedule or toggle a group to deny DNS lookups for specific devices or the whole network during set hours, which effectively stops most internet activity while keeping the network itself up.
What Pi-hole Actually Does
Pi-hole is a network-wide ad blocker that runs on a small computer like a Raspberry Pi. It acts as your network’s DNS server, meaning every device that uses it asks Pi-hole to translate domain names (like example.com) into IP addresses. Pi-hole can block requests to known ad and tracker domains, and you can also block entire domains manually. Because it sits between your devices and the internet, it can also be used to cut off internet access entirely for selected devices or at selected times by refusing to resolve any DNS queries.
It does not block traffic that uses IP addresses directly, nor does it block apps that use hardcoded IPs or encrypted DNS (DoH/DoT) that bypass your router’s DNS settings. For most home devices, though, DNS blocking is enough to stop web browsing, video streaming, and most app traffic.
Why Use Pi-hole for Bedtime Shutoff
Parents often want to limit children’s internet use at night, and people also want to enforce their own digital boundaries. A Pi-hole-based shutoff is attractive because it:
- Works network-wide, covering phones, tablets, computers, smart TVs, and game consoles at once.
- Can be scheduled automatically, so you don’t have to remember to turn things off.
- Can be applied to specific devices (e.g., a child’s tablet) while leaving others (e.g., your work laptop) untouched.
- Does not require installing software on each device.
It’s a lightweight, flexible solution compared to buying a new router or using parental control apps on every device.
How to Set Up a Bedtime Shutoff
There are two common methods: using Pi-hole’s built-in group management and using a cron job to disable/enable blocking. The group method is easier for most users.
- Create a group in Pi-hole’s web interface under Group Management → Groups. Name it something like “Bedtime Block”.
- Add devices to the group by going to Clients and adding each device’s IP address or MAC address. You can also add the whole network (0.0.0.0/0) if you want to block everything.
- Create a domain list under Domain Management → Domains. Add a single domain like
.(a dot) to block all DNS queries, or add specific domains if you only want to block certain sites. - Assign the domain list to the group by editing the group and checking that domain list.
- Schedule the block using a cron job on the Pi-hole host. For example, to block from 10 PM to 7 AM, you’d run a script at 22:00 that enables the group (sets the domain list to active) and at 07:00 that disables it. The Pi-hole API allows you to enable/disable blocking, but to toggle a group you’ll need to use the web interface’s API or a custom script that edits the gravity database.
A simpler approach is to use Pi-hole’s built-in Disable Blocking for a set time, but that only turns off ad blocking, not internet access. For a true shutoff, you need to block all DNS queries, which the group method does.
Common Problems and Fixes
Users often run into a few issues when setting up bedtime blocking:
- Devices still have internet – Check if the device is using a different DNS server (e.g., manual DNS settings or a VPN). Set your router to force all DNS through Pi-hole, or block outbound DNS traffic to other servers on your router.
- Schedule doesn’t fire – The cron job may not be running. Verify cron is active and the script path is correct. Test the script manually first.
- Blocking affects the wrong devices – Make sure you assigned the correct IPs to the group. If devices use DHCP, they might change IPs; use MAC addresses or set static leases.
- Pi-hole stops resolving after unblocking – If you use the API to disable blocking, it should resume automatically. If not, restart the DNS service or check the logs.
Alternatives to Pi-hole for Bedtime Shutoff
If you don’t have a Raspberry Pi or don’t want to maintain a Pi-hole, other options exist:
- Router parental controls – Many modern routers have built-in scheduling features that can turn off internet for specific devices at set times.
- Device-level screen time – iOS Screen Time and Android Digital Wellbeing allow per-app and per-device schedules.
- Third-party DNS services – Services like OpenDNS offer free parental controls that include time-based blocking, but they require a router that supports them.
- Physical timers – A simple smart plug on your router’s power can cut internet for everyone, but that’s crude and affects your own access too.
Pi-hole is more flexible and private than cloud DNS services, but it requires some technical setup.
Costs and Requirements
Running Pi-hole is inexpensive if you already have a Raspberry Pi or an old computer. A Raspberry Pi Zero costs around $15, plus a microSD card and power supply. You also need a network that lets you change the DNS server (most home routers do). The software itself is free and open source. There are no ongoing subscription fees. The main cost is your time to set it up and maintain it.
Safety and Privacy Considerations
Pi-hole does not log the content of your traffic, only DNS queries, and by default it keeps logs for a limited time. You can disable logging entirely. When you block DNS, you are not inspecting or filtering content; you are just refusing to resolve domain names. This means HTTPS traffic is not decrypted, and you cannot see what people are doing on allowed sites. Also, a determined user could bypass the block by using a VPN or by changing their device’s DNS settings, so it’s not a foolproof parental control. For younger children, it works well; for tech-savvy teens, it may be circumvented.
Frequently Asked Questions
Can I set a different bedtime for each device? Yes, by creating separate groups for each device or set of devices, and scheduling different cron jobs for each group. You can also use the web interface to manually toggle groups at different times.
Will Pi-hole block all internet traffic or just web browsing? It blocks DNS queries, so any app that uses DNS to find a server will be blocked. Some apps that use direct IP addresses or encrypted DNS may still work. For most apps and browsers, it works as a full internet shutoff.
Does this work with IPv6? Pi-hole supports IPv6, but you need to make sure your devices are using Pi-hole as their IPv6 DNS server. Many routers handle IPv6 DNS separately, so check your router settings.
Can I temporarily unblock a device without changing the schedule? Yes, you can manually disable blocking for a specific group via the web interface or API, and it will resume on the next scheduled cron job.
What happens if the Raspberry Pi is off? If Pi-hole is down, devices that rely on it for DNS will lose internet unless you have a fallback DNS configured. You can set a secondary DNS on your router, but that might bypass the block. It’s best to keep Pi-hole running 24/7.
Is there an easier way than cron jobs? Some users use the Pi-hole API with a script that runs on a schedule, or use a third-party tool like “Pi-hole Remote” apps that allow scheduling. But cron is the standard method and works reliably.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.