Skip to content



Currently I have moved to AdGuard Home solution for DNS based AdBlocking. Their software can run also inside docker. The main advantages of AdGuard are:

  • Less restrictive default ad guard rules - PiHole in default configuration did break login with Apple ID on mac os x and, there were small issues with android phone
  • You can convert uBlock rules into AdGuard rules
  • Rules are just a regexp!
  • It is much faster and uses less resources
  • There is a nifty ui where you can define your own mapping for local ip(Like I want to all devices in my home see HomeAssistant instance under address
  • Supports DNS over https!

Old DNS Adblock solution

PiHole & Cloudflare

Everybody is tracking you, Google, Russia(damn you Putin), China(damn you commies) and others. PiHole is nice software that blocks Ads/Trackin site on the DNS level. Additionaly I have mapped on my router Google DNS like to point to PiHole instance.

Also to increase security I also configured dns over https. Now everytime any device in my network hits Pihole dns server, it will use secure dns over https to resolve domain. There is a nice tutorial how to do this and this how my ansible configuration script looks like:

- hosts: master
  become: yes
    - name: restart cloudflared
      become: yes
        name: cloudflared
        enabled: yes
        state: restarted
    - name: reload systemctl
      become: yes
      command: systemctl daemon-reload
    - name: Check if cloudflared already installed
      command: 'cloudflared -v'
      register: is_cloudflared_installed
      ignore_errors: True
    - name: Download cloudflared
      when: is_cloudflared_installed is failed
        dest: /tmp/cloudflared-stable-linux-amd64.deb
    - name: Install cloudflared
      when: is_cloudflared_installed is failed
        deb: /tmp/cloudflared-stable-linux-amd64.deb
    - name: Ensure group "cloudflared" exists
        name: cloudflared
        state: present
    - name: Adding user cloudflared
        name: cloudflared
        group: cloudflared
        create_home: no
        shell: /usr/sbin/nologin
        append: yes
    - name: Create /etc/default/cloudflared
        src: ./etc/default/cloudflared.j2
        dest: /etc/default/cloudflared
        owner: cloudflared
        group: cloudflared
    - name: Change file ownership for /usr/local/bin/cloudflared
        path: /usr/local/bin/cloudflared
        owner: cloudflared
        group: cloudflared
    - name: Create cloudflared.service
        src: ./lib/systemd/system/cloudflared.service.j2
        dest: /lib/systemd/system/cloudflared.service
        - reload systemctl
        - restart cloudflared