Turn off DNS server at night?

Please recommend a way to schedule/automatically turn off the pihole DNS server from accepting request at night (1a to 6a)?

What is your goal in turning Pi-hole off?

One way to do this is put the Pi-hole on a power plug timer, and shutdown the Pi with a cron about 5 minutes prior to the timer turning off the power.

sudo shutdown now

Run this at 1 am. Have the timer turn off the power a few minutes later. When the power comes back on at 6 am, the Pi will boot.

Thank YOU for the reply.

I want the LAN network to go dark at night, for systems/devices and people.

We live on an island, with a limited monthly quota for our satellite connection.

I would need to learn cron, but having cron do a stop pihone at 1am
and then do a start pihole at 6am would work. I would need the syntax.

Maybe, I am going about it wrong, I am open to better ideas.

Scheduling pi-hole to be down and up at specific times probably won't accomplish what you want, entirely. You would only be disabling DNS, all other network traffic would still be active. Local client/device cache of name resolution may last long enough or devices may just use IPs and continue to create traffic, perhaps more, since they cannot resolve DNS. The router or even your satellite 'modem' would be a surefire way to sever the connection.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.