I think best is to start with a fresh Pi-OS lite image.
OOTB without Pi-hole installed or any changes made, below one should resolve to an IP address first:
$ dig +short install.pi-hole.net
aws-ls-lon1.pi-hole.net.
18.169.210.144
If not, you have networking issues that are not related to Pi-hole.
Above only applies for pre Pi-OS Bookworm releases.
Bookworm and above use NetworkManager instead of dhcpcd which can be configured with below (Network Manager Text User Interface):
sudo nmtui
EDIT: Some hints about prepping a Pi: