Pihole doesn't block ads when shifting back to router for DHCP ( switched of pihole DHCP ) but works the other way around

Yes. There are more than one way to use Pi-hole.

When you configure Pi-hole IP on the LAN/DHCP side:

  • the router advertises Pi-hole IP as DNS server;
  • every device on your network will directly use Pi-hole as DNS server

Setting Pi-hole on the WAN side also works, but with a small difference:

  • every device on your network will use the router IP as DNS server
  • only the router will use Pi-hole as upstream DNS server

Pi-hole will block ads in both cases.

These topics can help you understand the differences: