If, after reading https://pi-hole.net/2016/09/15/tips-for-accessing-your-pi-hole-remotely/ warnings about open ports for accessing your pi-hole dashboard remotely, you still wanna do it here’s how I did it.
I’m posting this ‘guide’ because I couldn’t find one on this forum nor googling. Sorry if I missed it
- Forward port 80 to pi-hole IP on your router (you can also forward 22 port for SSH).
- If you have a dynamic IP you’ll need a dyn. ip service like no-ip.com, it has free and paid services, depending on the domain address you select. This can be set on the majority of actual routers.
- Add to file
/var/www/html/admin/scripts/pi-hole/php/auth.phpthe domain you choose (
mydomain.comin this example):
// Check CORS
$AUTHORIZED_HOSTNAMES = array(
str_replace(array("[","]"), array("",""), $_SERVER["SERVER_NAME"]),
- You don’t need to restart the pi-hole, just enter the domain on your browser and that’s all!