Use my ISP provided router as backup DHCP server

I am interested in using my pi-hole server as my primary DHCP server; however, the system I am using is quite old, and may shut down sometimes

I want to be able to configure my setup so that the pi-hole is my main DHCP server, but if the pi-hole system goes down, I want my router to take over and act as the DHCP server, and once the pi-hole system is back up, to tell clients to use that as the DHCP server instead.

Sorry, but I doubt you will be able automate this.

It would require a script or app (running in your router) to detect that Pi-hole machine is down and automatically enable the router DHCP server.

I am interested in using my pi-hole server as my primary DHCP server

Why do you think your router's DHCP is inadequate?

yeah dual dhcp failover is awkward. in my experience you cant really have both offering leases at once without clients bouncing, so the "router takes over automatically" part usually needs something on the router watching the pi.

what has worked ok for me is keeping dhcp only on pihole day to day, short lease times (like 1h), and a simple heartbeat script/cron on the router (or a tiny always-on box) that enables the router dhcp pool only when the pi stops answering. when the pi comes back you flip it off again.

if the router firmware cant run that kind of check, probably easier to just keep router dhcp as the only server and point clients at pihole for dns only. less elegant but way less fragile when the old box randomly powers off.

Is there a way to configure the router dhcp so that the primary DNS is my pihole and the secondary dns is a public one like 1.1.1.1?

I want to ensure that the second one is used only if my pi hole is down

There is no real “primary” and “secondary” DNS server. Clients are free to choose from the list of advertised DNS Servers and may also switch between them. Advertising both Pi-hole and Cloudflare will probably lead to Pi-hole being bypassed.

This is not how routers work.

The router always advertise both DNS servers to all clients, then the client OS decides how to use the DNS servers, as explained by darkexplosiveqwx.