{"id":108,"date":"2024-08-29T10:00:00","date_gmt":"2024-08-29T10:00:00","guid":{"rendered":"https:\/\/netguide.io\/network\/pi-hole-add-whitelist-entries-without-admin-access\/"},"modified":"2026-08-14T19:26:18","modified_gmt":"2026-08-14T19:26:18","slug":"pi-hole-add-whitelist-entries-without-admin-access","status":"publish","type":"post","link":"https:\/\/netguide.io\/network\/en\/pi-hole-add-whitelist-entries-without-admin-access\/","title":{"rendered":"Pi-hole: Add whitelist entries without admin access"},"content":{"rendered":"<div id=\"netgu-254827484\" class=\"netgu-before-content netgu-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6258556257245998\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-6258556257245998\" \ndata-ad-slot=\"3494115342\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>\n<p class=\"wp-block-paragraph\"><strong>Pi-hole<\/strong> is a network-wide ad blocker that acts as a DNS sinkhole to block ads and tracking on all devices in a network. Pi-hole works at DNS level and can be installed on a small computer such as the Raspberry Pi or another Linux server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The problem: False positives with other family members<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you use the official blocklists, there should only be a few false positives. However, if you use more blocklists for Pihole, it can quickly happen that some websites do not work properly or are not accessible at all. As a Pihole admin, you just whitelist the domain, while the other people in the household who use Pihole have to wait until the admin has done this for them. Fortunately, there is a solution for this:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Pihole Simple Whitelist<\/h3>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"581\" src=\"https:\/\/netguide.io\/network\/wp-content\/uploads\/sites\/10\/2026\/08\/Pihole-Simple-Whitelist-1024x581-1.png\" alt=\"\" class=\"wp-image-147\" srcset=\"https:\/\/netguide.io\/network\/wp-content\/uploads\/sites\/10\/2026\/08\/Pihole-Simple-Whitelist-1024x581-1.png 1024w, \/wp-content\/uploads\/2024\/08\/Pihole-Simple-Whitelist-300x170.png 300w, \/wp-content\/uploads\/2024\/08\/Pihole-Simple-Whitelist-768x435.png 768w, \/wp-content\/uploads\/2024\/08\/Pihole-Simple-Whitelist-360x204.png 360w, \/wp-content\/uploads\/2024\/08\/Pihole-Simple-Whitelist.png 1388w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Image: <a href=\"https:\/\/github.com\/zigzag1001\/pihole-Simple-Whitelist?tab=readme-ov-file\">Github.com\/zigzag1001<\/a><\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Install Pihole Simple Whitelist<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"sudo su\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">sudo<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">su<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"cd \/var\/www\/html\/\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #79B8FF\">cd<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">\/var\/www\/html\/<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"mkdir whitelist\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">mkdir<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">whitelist<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"cd whitelist\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #79B8FF\">cd<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">whitelist<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"curl -O https:\/\/raw.githubusercontent.com\/zigzag1001\/pihole-Simple-Whitelist\/main\/whitelist-add.php \\\n     -O https:\/\/raw.githubusercontent.com\/zigzag1001\/pihole-Simple-Whitelist\/main\/style.css \\\n     -O https:\/\/raw.githubusercontent.com\/zigzag1001\/pihole-Simple-Whitelist\/main\/index.html\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">curl<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">-O<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">https:\/\/raw.githubusercontent.com\/zigzag1001\/pihole-Simple-Whitelist\/main\/whitelist-add.php<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">\\<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">     <\/span><span style=\"color: #79B8FF\">-O<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">https:\/\/raw.githubusercontent.com\/zigzag1001\/pihole-Simple-Whitelist\/main\/style.css<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">\\<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">     <\/span><span style=\"color: #79B8FF\">-O<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">https:\/\/raw.githubusercontent.com\/zigzag1001\/pihole-Simple-Whitelist\/main\/index.html<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Determine and copy the hash value of your Pihole Webui password:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"cat \/etc\/pihole\/setupVars.conf | grep WEBPASSWORD\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">cat<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">\/etc\/pihole\/setupVars.conf<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #F97583\">|<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #B392F0\">grep<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">WEBPASSWORD<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Set <code>$auth<\/code> in line 16 to the password hash.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"nano whitelist-add.php\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">nano<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">whitelist-add.php<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"&lt;?php\nif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n    if (isset($_POST['action']) &amp;&amp; $_POST['action'] === 'list') {\n        \/\/ List whitelisted domains\n        $command = &quot;sudo pihole -w -l | awk '{print $1, $2}'&quot;;\n        \n        $output = [];\n        exec\u200b(&quot;$command 2&gt;&amp;1&quot;, $output);\n        \n        echo &quot;&lt;pre&gt;&quot; . implode(&quot;\\n&quot;, $output) . &quot;&lt;\/pre&gt;&quot;;\n    } elseif (isset($_POST['action']) &amp;&amp; $_POST['action'] === 'disable') {\n        \/\/ https:\/\/www.crosstalksolutions.com\/the-worlds-greatest-pi-hole-and-unbound-tutorial-2023\/\n        \n        $XMin = 5; \/\/ Minutes to disable blocking\n        $XSec = $XMin * 60;\n        $auth = &quot;YOUR_PASSWORD_HASH&quot;; \/\/ `cat \/etc\/pihole\/setupVars.conf | grep WEBPASSWORD`\n        \n        $command = &quot;curl -s \\&quot;http:\/\/localhost\/admin\/api.php?disable={$XSec}&amp;auth={$auth}\\&quot;&quot;;\n        \n        $output = [];\n        $returnVar = 0;\n        exec\u200b(&quot;$command 2&gt;&amp;1&quot;, $output, $returnVar);\n        \n        if ($returnVar === 0) {\n            echo &quot;Disabled blocking for $XMin minutes. &quot;. implode(' ', $output);\n            $t=time();\n            $d=date(&quot;M-d H:i e&quot;,$t);\n            error_log(&quot;Disabled by {$_SERVER['REMOTE_ADDR']} - {$d}\\n&quot;, 3, &quot;\/var\/log\/pihole_disabled.log&quot;);\n        } else {\n            echo &quot;Failed. Blocking not disabled. Output: &quot; . implode(' ', $output);\n        }\n    } else {\n        \/\/ Whitelist a domain\n        $t=time();\n        $d=date(&quot;M-d H:i e&quot;,$t);\n        $domain = escapeshellarg($_POST['domain']);\n        $regex_domain = &quot;\/[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z]{2,6}\/&quot;;\n        $is_match = preg_match($regex_domain, $domain);\n        if ($is_match == 1) {\n            $command = &quot;sudo pihole -w $domain --comment \\&quot;{$_SERVER['REMOTE_ADDR']} - {$d}\\&quot;&quot;;\n            \n            $output = [];\n            $returnVar = 0;\n            exec\u200b(&quot;$command 2&gt;&amp;1&quot;, $output, $returnVar);\n            \n            if ($returnVar === 0) {\n                echo &quot;Domain $domain has been successfully whitelisted.&quot;;\n            } else {\n                echo &quot;Failed to whitelist domain $domain. Output: &quot; . implode(' ', $output);\n            }\n        } else {\n            echo &quot;Domain input is wrong.&quot;;\n        }\n    }\n}\n?&gt;\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F97583\">&lt;?<\/span><span style=\"color: #E1E4E8\">php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F97583\">if<\/span><span style=\"color: #E1E4E8\"> ($_SERVER[<\/span><span style=\"color: #9ECBFF\">&#39;REQUEST_METHOD&#39;<\/span><span style=\"color: #E1E4E8\">] == <\/span><span style=\"color: #9ECBFF\">&#39;POST&#39;<\/span><span style=\"color: #E1E4E8\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    <\/span><span style=\"color: #F97583\">if<\/span><span style=\"color: #E1E4E8\"> (<\/span><span style=\"color: #B392F0\">isset($_POST[<\/span><span style=\"color: #B392F0\">&#39;action&#39;<\/span><span style=\"color: #B392F0\">]<\/span><span style=\"color: #E1E4E8\">) &amp;&amp; $_POST[<\/span><span style=\"color: #B392F0\">&#39;action&#39;<\/span><span style=\"color: #B392F0\">]<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">===<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&#39;list&#39;<\/span><span style=\"color: #E1E4E8\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><span style=\"color: #B392F0\">\/\/<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">List<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">whitelisted<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">domains<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $command <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;sudo pihole -w -l | awk &#39;{print <\/span><span style=\"color: #79B8FF\">$1<\/span><span style=\"color: #9ECBFF\">, <\/span><span style=\"color: #79B8FF\">$2<\/span><span style=\"color: #9ECBFF\">}&#39;&quot;<\/span><span style=\"color: #E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $output <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> [];<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><span style=\"color: #79B8FF\">exec<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #B392F0\">&quot;<\/span><span style=\"color: #E1E4E8\">$command<\/span><span style=\"color: #B392F0\"> 2&gt;&amp;1&quot;<\/span><span style=\"color: #B392F0\">,<\/span><span style=\"color: #E1E4E8\"> $output);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><span style=\"color: #79B8FF\">echo<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;&lt;pre&gt;&quot;<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">.<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">implode<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #B392F0\">&quot;\\n&quot;<\/span><span style=\"color: #B392F0\">,<\/span><span style=\"color: #E1E4E8\"> $output) <\/span><span style=\"color: #9ECBFF\">.<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;&lt;\/pre&gt;&quot;<\/span><span style=\"color: #E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    } elseif (<\/span><span style=\"color: #B392F0\">isset($_POST[<\/span><span style=\"color: #B392F0\">&#39;action&#39;<\/span><span style=\"color: #B392F0\">]<\/span><span style=\"color: #E1E4E8\">) &amp;&amp; $_POST[<\/span><span style=\"color: #B392F0\">&#39;action&#39;<\/span><span style=\"color: #B392F0\">]<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">===<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&#39;disable&#39;<\/span><span style=\"color: #E1E4E8\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><span style=\"color: #B392F0\">\/\/<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">https:\/\/www.crosstalksolutions.com\/the-worlds-greatest-pi-hole-and-unbound-tutorial-2023\/<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $XMin <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">5<\/span><span style=\"color: #E1E4E8\">; <\/span><span style=\"color: #B392F0\">\/\/<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">Minutes<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">to<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">disable<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">blocking<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $XSec <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> $XMin <\/span><span style=\"color: #79B8FF\">*<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">60<\/span><span style=\"color: #E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $auth <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;YOUR_PASSWORD_HASH&quot;<\/span><span style=\"color: #E1E4E8\">; <\/span><span style=\"color: #B392F0\">\/\/<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">`<\/span><span style=\"color: #B392F0\">cat<\/span><span style=\"color: #9ECBFF\"> \/etc\/pihole\/setupVars.conf <\/span><span style=\"color: #F97583\">|<\/span><span style=\"color: #9ECBFF\"> <\/span><span style=\"color: #B392F0\">grep<\/span><span style=\"color: #9ECBFF\"> WEBPASSWORD`<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $command <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;curl -s <\/span><span style=\"color: #79B8FF\">\\&quot;<\/span><span style=\"color: #9ECBFF\">http:\/\/localhost\/admin\/api.php?disable={<\/span><span style=\"color: #E1E4E8\">$XSec<\/span><span style=\"color: #9ECBFF\">}&amp;auth={<\/span><span style=\"color: #E1E4E8\">$auth<\/span><span style=\"color: #9ECBFF\">}<\/span><span style=\"color: #79B8FF\">\\&quot;<\/span><span style=\"color: #9ECBFF\">&quot;<\/span><span style=\"color: #E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $output <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> [];<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $returnVar <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">0<\/span><span style=\"color: #E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><span style=\"color: #79B8FF\">exec<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #B392F0\">&quot;<\/span><span style=\"color: #E1E4E8\">$command<\/span><span style=\"color: #B392F0\"> 2&gt;&amp;1&quot;<\/span><span style=\"color: #B392F0\">,<\/span><span style=\"color: #E1E4E8\"> $output<\/span><span style=\"color: #9ECBFF\">,<\/span><span style=\"color: #E1E4E8\"> $returnVar);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><span style=\"color: #F97583\">if<\/span><span style=\"color: #E1E4E8\"> ($returnVar === 0) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            <\/span><span style=\"color: #79B8FF\">echo<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;Disabled blocking for <\/span><span style=\"color: #E1E4E8\">$XMin<\/span><span style=\"color: #9ECBFF\"> minutes. &quot;.<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">implode<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #B392F0\">&#39; &#39;<\/span><span style=\"color: #B392F0\">,<\/span><span style=\"color: #E1E4E8\"> $output);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            $t=time();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            $d=date(<\/span><span style=\"color: #B392F0\">&quot;M-d H:i e&quot;<\/span><span style=\"color: #B392F0\">,$t<\/span><span style=\"color: #E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            <\/span><span style=\"color: #B392F0\">error_log(<\/span><span style=\"color: #B392F0\">&quot;Disabled by {<\/span><span style=\"color: #E1E4E8\">$_SERVER<\/span><span style=\"color: #B392F0\">[&#39;REMOTE_ADDR&#39;]} - {<\/span><span style=\"color: #E1E4E8\">$d<\/span><span style=\"color: #B392F0\">}\\n&quot;<\/span><span style=\"color: #B392F0\">,<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">3<\/span><span style=\"color: #9ECBFF\">,<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;\/var\/log\/pihole_disabled.log&quot;<\/span><span style=\"color: #E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        } <\/span><span style=\"color: #F97583\">else<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            <\/span><span style=\"color: #79B8FF\">echo<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;Failed. Blocking not disabled. Output: &quot;<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">.<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">implode<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #B392F0\">&#39; &#39;<\/span><span style=\"color: #B392F0\">,<\/span><span style=\"color: #E1E4E8\"> $output);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    } <\/span><span style=\"color: #F97583\">else<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><span style=\"color: #B392F0\">\/\/<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">Whitelist<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">a<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">domain<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $t=time();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $d=date(<\/span><span style=\"color: #B392F0\">&quot;M-d H:i e&quot;<\/span><span style=\"color: #B392F0\">,$t<\/span><span style=\"color: #E1E4E8\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $domain <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">escapeshellarg<\/span><span style=\"color: #E1E4E8\">($_POST[<\/span><span style=\"color: #9ECBFF\">&#39;domain&#39;<\/span><span style=\"color: #E1E4E8\">]);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $regex_domain <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;\/[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z]{2,6}\/&quot;<\/span><span style=\"color: #E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        $is_match <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">preg_match<\/span><span style=\"color: #E1E4E8\">($regex_domain, $domain);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        <\/span><span style=\"color: #F97583\">if<\/span><span style=\"color: #E1E4E8\"> ($is_match == 1) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            $command <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;sudo pihole -w <\/span><span style=\"color: #E1E4E8\">$domain<\/span><span style=\"color: #9ECBFF\"> --comment <\/span><span style=\"color: #79B8FF\">\\&quot;<\/span><span style=\"color: #9ECBFF\">{<\/span><span style=\"color: #E1E4E8\">$_SERVER<\/span><span style=\"color: #9ECBFF\">[&#39;REMOTE_ADDR&#39;]} - {<\/span><span style=\"color: #E1E4E8\">$d<\/span><span style=\"color: #9ECBFF\">}<\/span><span style=\"color: #79B8FF\">\\&quot;<\/span><span style=\"color: #9ECBFF\">&quot;<\/span><span style=\"color: #E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            <\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            $output <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> [];<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            $returnVar <\/span><span style=\"color: #9ECBFF\">=<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #79B8FF\">0<\/span><span style=\"color: #E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            <\/span><span style=\"color: #79B8FF\">exec<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #B392F0\">&quot;<\/span><span style=\"color: #E1E4E8\">$command<\/span><span style=\"color: #B392F0\"> 2&gt;&amp;1&quot;<\/span><span style=\"color: #B392F0\">,<\/span><span style=\"color: #E1E4E8\"> $output<\/span><span style=\"color: #9ECBFF\">,<\/span><span style=\"color: #E1E4E8\"> $returnVar);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            <\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            <\/span><span style=\"color: #F97583\">if<\/span><span style=\"color: #E1E4E8\"> ($returnVar === 0) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">                <\/span><span style=\"color: #79B8FF\">echo<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;Domain <\/span><span style=\"color: #E1E4E8\">$domain<\/span><span style=\"color: #9ECBFF\"> has been successfully whitelisted.&quot;<\/span><span style=\"color: #E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            } <\/span><span style=\"color: #F97583\">else<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">                <\/span><span style=\"color: #79B8FF\">echo<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;Failed to whitelist domain <\/span><span style=\"color: #E1E4E8\">$domain<\/span><span style=\"color: #9ECBFF\">. Output: &quot;<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">.<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">implode<\/span><span style=\"color: #E1E4E8\">(<\/span><span style=\"color: #B392F0\">&#39; &#39;<\/span><span style=\"color: #B392F0\">,<\/span><span style=\"color: #E1E4E8\"> $output);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        } <\/span><span style=\"color: #F97583\">else<\/span><span style=\"color: #E1E4E8\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">            <\/span><span style=\"color: #79B8FF\">echo<\/span><span style=\"color: #E1E4E8\"> <\/span><span style=\"color: #9ECBFF\">&quot;Domain input is wrong.&quot;<\/span><span style=\"color: #E1E4E8\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">        }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #B392F0\">?&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Save: CTRL + O and Close: CTRL + X<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now you can access <a href=\"http:\/\/pi.hole\/whitelist\/\">http:\/\/pi.hole\/whitelist\/<\/a> in your browser.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Pihole: Simple Whitelist is a project by zigzag1001 on <a href=\"https:\/\/github.com\/zigzag1001\/pihole-Simple-Whitelist\">Github<\/a>.<\/p>\n<div id=\"netgu-2319078930\" class=\"netgu-after-content netgu-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-6258556257245998\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-6258556257245998\" \ndata-ad-slot=\"4559785002\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Add Pi-hole whitelist entries without admin access: install the Pihole Simple Whitelist tool so anyone on your home network can whitelist blocked domains.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[8],"tags":[],"class_list":["post-108","post","type-post","status-publish","format-standard","hentry","category-uncategorized-en"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Tobias Pries","author_link":"https:\/\/netguide.io\/network\/author\/tobias-pries\/"},"uagb_comment_info":0,"uagb_excerpt":"Add Pi-hole whitelist entries without admin access: install the Pihole Simple Whitelist tool so anyone on your home network can whitelist blocked domains.","brizy_media":[],"_links":{"self":[{"href":"https:\/\/netguide.io\/network\/wp-json\/wp\/v2\/posts\/108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netguide.io\/network\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netguide.io\/network\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netguide.io\/network\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netguide.io\/network\/wp-json\/wp\/v2\/comments?post=108"}],"version-history":[{"count":1,"href":"https:\/\/netguide.io\/network\/wp-json\/wp\/v2\/posts\/108\/revisions"}],"predecessor-version":[{"id":148,"href":"https:\/\/netguide.io\/network\/wp-json\/wp\/v2\/posts\/108\/revisions\/148"}],"wp:attachment":[{"href":"https:\/\/netguide.io\/network\/wp-json\/wp\/v2\/media?parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netguide.io\/network\/wp-json\/wp\/v2\/categories?post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netguide.io\/network\/wp-json\/wp\/v2\/tags?post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}