For those who are new to Linux , these are the steps I used to solve the same problem:
pi@raspberrypi:~ $ sudo nano /etc/resolv.conf
--- > Paste in google’s nameserver 8.8.8.8
Save and exit nano
pi@raspberrypi:~ $ cat /etc/resolv.conf
Generated by dhcpcd
/etc/resolv.conf.head can replace this line
/etc/resolv.conf.tail can replace this line
nameserver 8.8.8.8
pi@raspberrypi:~ $
pi@raspberrypi:~ $ pihole -r
--- > Existing Install Detected
--- > Choose Repair (This will retain existing settings)
--- > Hit Tab to move to the OK button. Press ENTER key