{"id":6105,"date":"2022-12-21T22:16:31","date_gmt":"2022-12-21T16:16:31","guid":{"rendered":"https:\/\/10.100.1.199\/?p=6105"},"modified":"2023-03-14T17:10:14","modified_gmt":"2023-03-14T11:10:14","slug":"pi-hole-dns","status":"publish","type":"post","link":"https:\/\/saq-digital.com\/kk\/pi-hole-dns\/","title":{"rendered":"How to setup Pi-Hole to block\u00a0trackers and ads"},"content":{"rendered":"<p>Pi-hole is an open-source Linux based network-level advertisement and Internet tracker blocking application which acts as a private DNS. (Optionally\u00a0a DHCP server) It is designed for low-power embedded devices with network capability, such as the Raspberry Pi. But it can be installed on almost any Linux machine.<\/p>\n\n\n\n<p>We are able to block advertisements &amp; tracking domains for desktops, mobile devices, or any other smart devices which are staying behind Pi-hole. As for functions, it&#8217;s quite similar to a network firewall.<\/p>\n\n\n\n<p>Pi-hole is useful at home network to block ads and trackers to protect yourself. Meanwhile you can use Pi-hole to block any sites or apps that shouldn&#8217;t be showing up on the devices of your family members, especially for kids.<\/p>\n\n\n\n<p>In this example, we are going to install Pi-hole on LXC container on ProxMox, as it&#8217;s lightweight, takes up less disk space, CPU and memory.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Choose storage on the ProxMox, find CT templates, click Templates<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"538\" height=\"253\" src=\"http:\/\/10.100.1.199\/wp-content\/uploads\/2022\/12\/pi-hole-install-01.jpg\" alt=\"\" class=\"wp-image-6108\" srcset=\"https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-01.jpg 538w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-01-300x141.jpg 300w\" sizes=\"(max-width: 538px) 100vw, 538px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>On Search bar type Ubuntu, and choose version 22.04 standard to downalod.  As soon as CT template is ready, click Create CT on ProxMox.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"754\" height=\"271\" src=\"http:\/\/10.100.1.199\/wp-content\/uploads\/2022\/12\/pi-hole-install-02.jpg\" alt=\"\" class=\"wp-image-6109\" srcset=\"https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-02.jpg 754w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-02-300x108.jpg 300w\" sizes=\"(max-width: 754px) 100vw, 754px\" \/><\/figure>\n\n\n\n<p>Here is the basic settings for Pi-hole container:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>General: type host name as you want, and set password for root user, click next<\/li>\n\n\n\n<li>Template: select the one we have downloaded, eg ubuntu-22.04-standard_22.04-1_amd64.tar.zst<\/li>\n\n\n\n<li>Disk: type disk size, eg, I use 4 GB<\/li>\n\n\n\n<li>CPU: select the core numbers, normally pi-hole consumes low computing resource, it means 1 core should be enough.<\/li>\n\n\n\n<li>Memory: 512 MB<\/li>\n\n\n\n<li>Network: Pi-hole needs fixed IP address, we have to set the IP manually, eg 10.10.100.110\/24, then type your network gateway.<\/li>\n\n\n\n<li>DNS: leave them as default, we will change this after Pi-hole up and running, in that case DNS server will be 10.10.100.110 (as we set previously).<\/li>\n\n\n\n<li>Confirm and start the container.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"720\" height=\"338\" src=\"http:\/\/10.100.1.199\/wp-content\/uploads\/2022\/12\/pi-hole-install-04.jpg\" alt=\"\" class=\"wp-image-6112\" srcset=\"https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-04.jpg 720w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-04-300x141.jpg 300w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<p>It&#8217;s highly recommended to update the container. Also curl needs to be installed:<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-palette-color-4-background-color has-text-color has-background\"><code>apt update \napt upgrade\napt install curl\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"232\" src=\"http:\/\/10.100.1.199\/wp-content\/uploads\/2022\/12\/pi-hole-install-05.jpg\" alt=\"\" class=\"wp-image-6113\" srcset=\"https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-05.jpg 750w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-05-300x93.jpg 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure>\n\n\n\n<p>Install Pi-hole <\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-palette-color-4-background-color has-text-color has-background\"><code>curl -sSL https:\/\/install.pi-hole.net | bash<\/code><\/pre>\n\n\n\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<div class=\"wp-block-stackable-columns stk-block-columns stk-block stk-72d56a5\" data-block-id=\"72d56a5\"><div class=\"stk-row stk-inner-blocks stk-block-content stk-content-align stk-72d56a5-column\">\n<div class=\"wp-block-stackable-column stk-block-column stk-block-column--v3 stk-column stk-block-column--v2 stk-block stk-9543330\" data-block-id=\"9543330\"><div class=\"stk-column-wrapper stk-block-column__content stk-container stk-9543330-container stk--no-background stk--no-padding\"><div class=\"stk-block-content stk-inner-blocks stk-9543330-inner-blocks\">\n<p>Please select default options to continue. Regarding upstream DNS, feel free to choose the one that you normally use, I use Cloudflare. At last, it will show you the control panel with password. <\/p>\n<\/div><\/div><\/div>\n<\/div><\/div>\n<\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"629\" height=\"341\" src=\"http:\/\/10.100.1.199\/wp-content\/uploads\/2022\/12\/pi-hole-install-14.jpg\" alt=\"\" class=\"wp-image-6118\" srcset=\"https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-14.jpg 629w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-14-300x163.jpg 300w\" sizes=\"(max-width: 629px) 100vw, 629px\" \/><\/figure>\n\n\n\n<p>Use web browser to access http:\/\/10.10.100.110\/admin. <\/p>\n\n\n\n<p>In order to block ads and tracking, we need to update the adlists, by default there is only 1 adlists.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"626\" src=\"http:\/\/10.100.1.199\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-dns-1024x626.jpg\" alt=\"\" class=\"wp-image-6120\" srcset=\"https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-dns-1024x626.jpg 1024w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-dns-300x183.jpg 300w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-dns-768x470.jpg 768w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-dns.jpg 1238w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Firebog (<a href=\"https:\/\/firebog.net\/\">https:\/\/firebog.net\/<\/a>) is the most popular site that regularly updates the blacklist.  You can copy the lists (eg lists in green and blue, or please check reading points for more on Firebog)  and add them to new adlist on the Pi-hole. it&#8217;s possible to copy more lists and add them in single adlist on Pi-hole, shown below.  <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"713\" height=\"377\" src=\"http:\/\/10.100.1.199\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-firebog.jpg\" alt=\"\" class=\"wp-image-6121\" srcset=\"https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-firebog.jpg 713w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-firebog-300x159.jpg 300w\" sizes=\"(max-width: 713px) 100vw, 713px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"996\" height=\"375\" src=\"http:\/\/10.100.1.199\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-add-lists.jpg\" alt=\"\" class=\"wp-image-6122\" srcset=\"https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-add-lists.jpg 996w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-add-lists-300x113.jpg 300w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-adlists-add-lists-768x289.jpg 768w\" sizes=\"(max-width: 996px) 100vw, 996px\" \/><\/figure>\n\n\n\n<p>After you finish the adding lists, go to Tools, Update Gravity, and click update, wait for a few seconds before it is marked as Success. Otherwise adlists that we have added above won&#8217;t take effect on Pi-hole.<\/p>\n\n\n\n<p>As you can see, I have more than 5.7 million blocked domains on my list, and the block rate is up to 36.5%! <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"995\" height=\"357\" src=\"http:\/\/10.100.1.199\/wp-content\/uploads\/2022\/12\/pi-hole-install-dns-blocklist-5million.jpg\" alt=\"\" class=\"wp-image-6126\" srcset=\"https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-dns-blocklist-5million.jpg 995w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-dns-blocklist-5million-300x108.jpg 300w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-dns-blocklist-5million-768x276.jpg 768w\" sizes=\"(max-width: 995px) 100vw, 995px\" \/><\/figure>\n\n\n\n<p>Last thing is to set the IP address (in our example 10.10.100.110) of your Pi-hole as your local DNS server, normally you can add this on your local DHCP server. <\/p>\n\n\n\n<p><strong>Note<\/strong>: in some cases, web sites you need might be blocked out by adlists, in this case you can unblock them by adding them to whitelist: Go to Query Log, Show All, and search the domain (eg windows.com), add them to whitelist if blocked. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"537\" src=\"http:\/\/10.100.1.199\/wp-content\/uploads\/2022\/12\/pi-hole-install-queries-lists-1-1024x537.jpg\" alt=\"\" class=\"wp-image-6124\" srcset=\"https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-queries-lists-1-1024x537.jpg 1024w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-queries-lists-1-300x157.jpg 300w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-queries-lists-1-768x402.jpg 768w, https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-install-queries-lists-1.jpg 1229w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>","protected":false},"excerpt":{"rendered":"<p>Pi-hole is an open-source Linux based network-level advertisement and Internet tracker blocking application which acts as a private DNS. (Optionally\u00a0a DHCP server) It is designed for low-power embedded devices with network capability, such as the Raspberry Pi. But it can be installed on almost any Linux machine. We are able to block advertisements &amp; tracking [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6143,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[103,84,128],"tags":[130,117,92,131],"class_list":["post-6105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cybersecurity","category-dns","category-proxmox","tag-container","tag-cyber-security","tag-dns","tag-proxmox"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"aioseo_notices":[],"featured_image_urls_v2":{"full":["https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-dns-server-saq-digital.jpg",1997,1123,false],"thumbnail":["https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-dns-server-saq-digital-150x150.jpg",150,150,true],"medium":["https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-dns-server-saq-digital-300x169.jpg",300,169,true],"medium_large":["https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-dns-server-saq-digital-768x432.jpg",768,432,true],"large":["https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-dns-server-saq-digital-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-dns-server-saq-digital-1536x864.jpg",1536,864,true],"2048x2048":["https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-dns-server-saq-digital.jpg",1997,1123,false],"trp-custom-language-flag":["https:\/\/saq-digital.com\/wp-content\/uploads\/2022\/12\/pi-hole-dns-server-saq-digital.jpg",18,10,false]},"post_excerpt_stackable_v2":"<p>Pi-hole is an open-source Linux based network-level advertisement and Internet tracker blocking application which acts as a private DNS. (Optionally\u00a0a DHCP server) It is designed for low-power embedded devices with network capability, such as the Raspberry Pi. But it can be installed on almost any Linux machine. We are able to block advertisements &amp; tracking domains for desktops, mobile devices, or any other smart devices which are staying behind Pi-hole. As for functions, it&#8217;s quite similar to a network firewall. Pi-hole is useful at home network to block ads and trackers to protect yourself. Meanwhile you can use Pi-hole to&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/saq-digital.com\/kk\/category\/cybersecurity\/\" rel=\"category tag\">CyberSecurity<\/a>, <a href=\"https:\/\/saq-digital.com\/kk\/category\/infrastructure\/servers\/dns\/\" rel=\"category tag\">DNS<\/a>, <a href=\"https:\/\/saq-digital.com\/kk\/category\/infrastructure\/virtualization\/proxmox\/\" rel=\"category tag\">ProxMox<\/a>","author_info_v2":{"name":"SAQ","url":"https:\/\/saq-digital.com\/kk\/author\/serik-akim\/"},"comments_num_v2":"0 comments","brizy_media":[],"_links":{"self":[{"href":"https:\/\/saq-digital.com\/kk\/wp-json\/wp\/v2\/posts\/6105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/saq-digital.com\/kk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/saq-digital.com\/kk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/saq-digital.com\/kk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/saq-digital.com\/kk\/wp-json\/wp\/v2\/comments?post=6105"}],"version-history":[{"count":9,"href":"https:\/\/saq-digital.com\/kk\/wp-json\/wp\/v2\/posts\/6105\/revisions"}],"predecessor-version":[{"id":6298,"href":"https:\/\/saq-digital.com\/kk\/wp-json\/wp\/v2\/posts\/6105\/revisions\/6298"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/saq-digital.com\/kk\/wp-json\/wp\/v2\/media\/6143"}],"wp:attachment":[{"href":"https:\/\/saq-digital.com\/kk\/wp-json\/wp\/v2\/media?parent=6105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/saq-digital.com\/kk\/wp-json\/wp\/v2\/categories?post=6105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/saq-digital.com\/kk\/wp-json\/wp\/v2\/tags?post=6105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}