But seriously:
This already exists (e.g.):
- Setting up a Raspberry Pi as a Wireless Access Point
- How to use Raspberry Pi as a wireless router with firewall?
- Firewall your home network with a Raspberry Pi
- DHCP and DNS are provided by Pi-hole
For a LAN-LAN-firewall realised with a Raspberry Pi you need a second LAN interface (via USB), only RasPi 3B+ an 4B provide Gbit-Ethernet (1000Mbit/s) and only a RasPi 4B is equipped with USB 3.0 for Gbit USB-LAN. The RasPi firewall will be the bottleneck in your network!
Maybe other Hardware suits you more:
- 10 Best Raspberry Pi Alternatives Comparison: x86 And ARM SBCs For 2019
- Or a "proper" PC?!
Deny or allow access to specific domains on demand by using a script like:
#!/bin/bash
pihole whitelist domain1.tld domain2.tld
to grant access and
#!/bin/bash
pihole whitelist -d domain1.tld domain2.tld
or
#!/bin/bash
pihole blacklist domain1.tld domain2.tld
to block access!
From the Pi-hole documentation: Editing Whitelist and Blacklist
For more details on scripting: Bash Scripting Tutorial
And to automate the execution of the scripts use cron:
A Beginners Guide To Cron Jobs
Addendum: similar request here: Second level Blacklist triggered on a schedule
So you really want Pi-hole to cook you coffee?!