How to enable remote internet access for pi-hole web dashboard



If, after reading 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 :crazy_face:

  1. Forward port 80 to pi-hole IP on your router (you can also forward 22 port for SSH).
  2. If you have a dynamic IP you’ll need a dyn. ip service like, it has free and paid services, depending on the domain address you select. This can be set on the majority of actual routers.
  3. Add to file /var/www/html/admin/scripts/pi-hole/php/auth.php the domain you choose ( in this example):
    // Check CORS
    str_replace(array("[","]"), array("",""), $_SERVER["SERVER_NAME"]),
  4. You don’t need to restart the pi-hole, just enter the domain on your browser and that’s all!