{"id":394,"date":"2023-04-07T20:16:52","date_gmt":"2023-04-07T20:16:52","guid":{"rendered":"https:\/\/thered.tech\/?p=394"},"modified":"2023-04-07T20:16:52","modified_gmt":"2023-04-07T20:16:52","slug":"aptj-tech-re-postcreating-your-own-personal-ad-blocker-a-step-by-step-guide-to-setting-up-pi-hole-dns-server","status":"publish","type":"post","link":"https:\/\/thered.tech\/?p=394","title":{"rendered":"APTJ.TECH Re-post:Creating Your Own Personal Ad Blocker: A Step-by-Step Guide to Setting Up Pi-Hole DNS Server"},"content":{"rendered":"\n<p>These instructions are from my old blog A Pentester&#8217;s Journey, I have left the content mainly original. One of the biggest goals I have for this website it showing my growth, so by posting my older content here as well as creating new content I hope to show the you all the growth Ive made in not only creating these projects but my ability to document them in a reader friendly way. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Supplies<\/h2>\n\n\n\n<p>What you\u2019ll need for this walk through:<\/p>\n\n\n\n<ul>\n<li>Raspberry Pi (anything from the Raspberry Pi Zero and Up, This Walk-through uses a Raspberry PI 3B+)<\/li>\n\n\n\n<li>Network connection (Either Wireless, or wired)<\/li>\n\n\n\n<li>Ethernet cable (if using wired connection)<\/li>\n\n\n\n<li>HDMI Cable<\/li>\n\n\n\n<li>HDMI compatible monitor&nbsp;<\/li>\n\n\n\n<li>Input devices (mouse, keyboard)<\/li>\n\n\n\n<li>A micro SD card (minimum of 2gbs, plus adapter if your pc doesn&#8217;t have a micro sd card slot)&nbsp;<\/li>\n\n\n\n<li>A Computer to run the image software.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Initial Set Up of Your Raspberry Pi<\/h2>\n\n\n\n<p>First you need to image Raspberry OS onto a raspberry Pi as the set up is a lot more familiar to the everyday user, with a desktop environment<br>(<em>You can use this walk-through to create a PI hole on a Raspberry Pi running in headless mode (no monitor) as all the Pi Hole initial install and setup is through the terminal anyway, just set up the raspberry pi in headless mode, it is noted in the walk-through were you can pick back up, and use the commands from this walk-through, or you can just click <a href=\"#Pi-hole\" data-type=\"internal\" data-id=\"#Pi-hole\">HERE<\/a>)<\/em><\/p>\n\n\n\n<ul>\n<li>To create a raspberry pi OS image first plug in your SD card to your computer<\/li>\n\n\n\n<li>You will need to install\u00a0 the Raspberry PI OS installer<br>\u00a0 (you can get it from the following website: <a href=\"https:\/\/www.raspberrypi.com\/software\/\">https:\/\/www.raspberrypi.com\/software\/<\/a>)<\/li>\n\n\n\n<li>Open the Raspberry Pi Imager<\/li>\n\n\n\n<li><img decoding=\"async\" loading=\"lazy\" width=\"385\" height=\"257\" src=\"https:\/\/lh5.googleusercontent.com\/RMcjduZ9ojaN1H-mc_iE0Ew_m51qXf1KtNUuebPLZEawgeQaeaRNBFCN3FzgT4Y-RHRYSQEL1_MZ_WXJu2eRc3nWhZn8HHJA8pJF94eJzPIMHaPTRO0YgEJnMo-3-dojh1UhJHR-To5fff87rDdREu4\"><\/li>\n\n\n\n<li>Next Click choose OS, an Operating System menu will appear, choose Raspberry Pi OS (32-bit)<br><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/lh5.googleusercontent.com\/0hCVR7wNQ5CdvJ4jCnXpxxG85OX9ATcE3PeKNsFq8JTo8YtDHjCyoaEvSKBQvqzFxq_wUDderWQI-lssp2sDMw0ePszXqxct4Ds8lDrHcvABrhJLJ4fLiCKx_Dlcb_Z8nW6KgOwdtuwLyyIxIY85g0w\" width=\"416\" height=\"270\"><\/li>\n\n\n\n<li>Next click \u201cCHOOSE STORAGE\u201d and click on your SD drive<\/li>\n\n\n\n<li>Next Click \u201cWRITE\u201d and wait for the write to finish<\/li>\n<\/ul>\n\n\n\n<p>After your SD has finished, take it out of your computer and then plug it into your raspberry pi, Connect all peripheral devices (ie., mouse, keyboard, monitor, Ethernet cable) and turn you PI on.<\/p>\n\n\n\n<ul>\n<li>Upon first boot you will be greeted with this message:<br><img decoding=\"async\" loading=\"lazy\" width=\"431\" height=\"257\" src=\"https:\/\/lh5.googleusercontent.com\/HkiLq-h8lmJEp_rYyNVUdFPBkakZYQrxObyejIozmYSDRx_IXu-SjTTGVz6KR0WFauixP0TaU7ZQeaEdkcHk90VKUzTv3kypbzOq20LR33MvQSg5rNwjNcqGljfzejnzH8iuVbrNs5ppIg0vn5d5nT4\"><br>Click \u201cNext\u201d<br><\/li>\n\n\n\n<li>Set your Country, Language, and Timezone, then click on Next again.<br><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/wHZG5VqC0X5wOK-6z67n7lxM3xZvEbuDaTwW_4E_jE2Ed-eftdPQcYJHHxnPg3GmLUMNPwYNrpZi30iDUKnPUGJ_enn7TiU7SlQLf5VoaiwjWSJlc65gbltKNGmV_F6TLXEbrTDjufoI2n54XKIpfbU\" width=\"458\" height=\"364\"><\/li>\n\n\n\n<li>Enter a new username and password for your Raspberry Pi and click on Next.<br><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/2sKLuE0X1NwVUG9_64YHdaFrCvt0FND8TAHvhWQpVJXettzAn2F6B1YiQUx4ZhhrzmJHOcU7K4aMeqMEve1GJRT6T5nulI4675Vjki4aZFKAWkGva45hVlVgy38BN8TOBcTN4NIZgHVByRgo-VHHcLU\" width=\"371\" height=\"295\"><\/li>\n\n\n\n<li>Set up your screen so that the Desktop completely fills your monitor.<br><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/E_qneojdWtlBM4QHXvD2Fqdrd_WPVddMuypCtG1t6VRArjm76AiCUOa-B6Wok1cHTQmIB9TWJSjVOUxf2EHU-zGWV-uFM9sxPEZEiCf-qzRBZ3aaqGZbD9IrsrIKvzmPSUuERQ8OP7oBg0gtSTk3nD0\" width=\"458\" height=\"365\"><\/li>\n\n\n\n<li>Connect to your wireless network by selecting its name, entering the passwork, and clicking on Next.<br><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/lh4.googleusercontent.com\/-qBt_KYKz1BhEDiVIyR9qdUUkCpmyZ3XB5r2ZxVuQfB1M-Nje7La8M2-KvGRONzEel1o5Y_SNnK_BUkPN2MjqqBn0EQQGXSRIIAdXTrLu1mBbl8GT46IqyRn0PWK2hd5pZctTX9e1cfqJRPczoSRfl8\" width=\"458\" height=\"364\"><\/li>\n\n\n\n<li>Click on Next, and let the wizard check for updates to Raspberry Pi OS and install them (this might take a few mins)<br><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/jwnZiAl-I9kLW93kaXHB9aXOddIUGfTMc7REigj0OVGCKfhuOXiFe1eJGr2kXRP53cXLHyolTaLnCSr179BR50mUZ0B0WlQHZUQCruOElwJ2IKCDq-_eZl5SRY2QbPZqiFVYOsm2FkgSqSluUEz-H9A\" width=\"459\" height=\"365\"><\/li>\n\n\n\n<li>Click on Restart to finish the setup.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"Pi-hole\">Installing Pi Hole<\/h2>\n\n\n\n<p id=\"This\"><em>This is where anyone who setup their Pi in headless mode should start following agai<\/em>n. <\/p>\n\n\n\n<p>If your raspberry Pi is running in desktop mode you will first need to open the terminal, if you are running in headless mode you can start entering in commands right away.<\/p>\n\n\n\n<ul>\n<li>First we are going to make sure or raspberry PI OS is fully updated with the following command:<br><br>Sudo apt-get update &amp;&amp; sudo apt-get upgrade<br><\/li>\n\n\n\n<li>Next we will install PI-Hole on to our device with the following command:<br><br>Curl -sSl https:\/\/install.pi-hole.net | bash<img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/lh6.googleusercontent.com\/yMql2hfw9Udhqx2lfbkfZRvnhBsy7W4aPYEvHAxTM9_UHSFIzLXYhiyDOjpIwB78Fs2h3js4Wzvp45RfMrQUB_T9LBm_WYSOdH7-i6nBu8K-abWZ0l-J-E4jgv7r4ihyWeVvuBD5F3JYIKTSbOaVzC4\" width=\"501\" height=\"282\"><\/li>\n\n\n\n<li>After the two above commands have been executed Pi Hole should be installed on your device and you should be greeted by the Pi-hole automated installer&nbsp;<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/F94CZ5JeMQrSZrXligNfS044oPw9yAYTo8KjzCn6on2oAZ2Ykd-08HuaWZKDD9nwiMJ4tIT7ltgZlLt_9RBmtNDQdXCZdKYlB-hcq8N7nDBDlam3eI8N093RcRHgAjUKsKw9D6hAi_IBsPgxM7fHxXA\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/W1iigQ_STDLfC62UHjvLwWUB7v8ds701sOZC3h4LgyVVaLmidbD6AIcHv0l8c1tiBgnrFbxAvZ177h1EMSaw76O0gnU3WZ7OUu4tu6n_OzhxZWg5XTZo7qLb1biaZgslcHrbMGkSGq25UudS-CKMIeQ\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/TvVxznD8RpP65uDsO2QwSWB_OU10Q26dKaYGvDtFLxp0iTk9uCNPRuuZhutH13ox-4EDSiSBgdevboy6OXpj97AnbBaTKayZZb5vT4Q7YwCjvO98SG6dah8Kjr7iATqGh2N59O5XRUyTx55FR6Kk3mI\" alt=\"\"\/><\/figure>\n\n\n\n<p>Having done all of this you will now be able to access the Web Interface of your Raspberry Pi Pi-Hole System as you can see occurring in the last three frames of the above image. From any locally connected device you will be able to access this Web Interface. Just type in the provided IP Address followed by <strong>| \/admin |<\/strong> into the URL of any internet browser. In my case I typed <strong>|<\/strong><a href=\"http:\/\/192.168.1.188\/admin\"><strong> <\/strong><strong>http:\/\/192.168.1.188\/admin<\/strong><\/a><strong> |<\/strong>. It will then request the Pi-Hole Password to access the Web Interface. If you want to change your unique default Pi-Hole password type and enter into a new Terminal window the following <strong>| pihole -a -p |<\/strong>. It will then prompt for a new password, if none is provided the password required to access the Web Interface will be removed.&nbsp;<\/p>\n\n\n\n<p>If you want to make big changes remotely, turning on SSH in the Raspberry Pi Configuration at this point would be a great idea. If you are going to install your Pi-Hole in a place that is hard to access\/not near a monitor then doing this is a necessity.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These instructions are from my old blog A Pentester&#8217;s Journey, I have left the content mainly original. One of the biggest goals I have for this website it showing my growth, so by posting my older content here as well as creating new content I hope to show the you all the growth Ive made&#8230;<\/p>\n","protected":false},"author":1,"featured_media":395,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":""},"categories":[11],"tags":[],"wbAuthor":{"name":"The Red Tech","link":"https:\/\/thered.tech\/?author=1"},"wbCategories":{"space":"<a href=\"https:\/\/thered.tech\/?cat=11\" rel=\"category\">How-To's<\/a>","coma":"<a href=\"https:\/\/thered.tech\/?cat=11\" rel=\"category\">How-To's<\/a>"},"wbComment":1,"wbReadTime":{"min":3,"sec":45},"_links":{"self":[{"href":"https:\/\/thered.tech\/index.php?rest_route=\/wp\/v2\/posts\/394"}],"collection":[{"href":"https:\/\/thered.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thered.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thered.tech\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thered.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=394"}],"version-history":[{"count":6,"href":"https:\/\/thered.tech\/index.php?rest_route=\/wp\/v2\/posts\/394\/revisions"}],"predecessor-version":[{"id":401,"href":"https:\/\/thered.tech\/index.php?rest_route=\/wp\/v2\/posts\/394\/revisions\/401"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thered.tech\/index.php?rest_route=\/wp\/v2\/media\/395"}],"wp:attachment":[{"href":"https:\/\/thered.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thered.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thered.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}