The Raspberry Pi Zero W has a micro sd card (2GB) plugged in with the headless operating system raspbian(linux distro)
Raspberry Pi Zero Specs https://www.raspberrypi.org/pi-zero-w/
The power adapter plugs into the USB C port that is the farthest from the center of the board.
The other USB C port can be used for power and data.
Remove the micro sd card and open the contents on the computer.
Create the file "wpa_supplicant.conf"
Edit and save the text below NOTE!!! The pi zero w can only connect to 2.4ghz networks.
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<Insert 2 letter ISO 3166-1 country code here>
network={
ssid="<Name of your wireless LAN>"
psk="<Password for your wireless LAN>"
}
https://www.raspberrypi.org/documentation/configuration/wireless/headless.md
Safely eject the sd card and boot the pi.
The light on the pi will flash as it boots.
There are multiple ways to access the pi. See https://www.raspberrypi.org/documentation/remote-access/
My preferred method is SSH (I enabled it already by creating an empty file named ssh) https://www.raspberrypi.org/documentation/remote-access/ssh/README.md
I recommend using Putty https://www.putty.org/
use the hostname raspberrypi
login as pi
password is password
I recommend changing the password
After connecting use the command passwd
Open a ssh session
run the command sudo raspi-config
navigate using the arrows and enter
I highly recommend reading the documentation https://docs.pi-hole.net/guides/unbound/
Important steps
Command
sudo apt install unbound
https://docs.pi-hole.net/guides/unbound/#configure-unbound
sudo service unbound restart
dig pi-hole.net @127.0.0.1 -p 5335
Run the command and follow the prompts. Default options are ok except for the DNS (see DNS section below)
curl -sSL https://install.pi-hole.net | bash
https://github.com/pi-hole/pi-hole/#one-step-automated-install
Select custom
Insert 127.0.0.1#5335
https://docs.pi-hole.net/guides/unbound/#configure-pi-hole
https://discourse.pi-hole.net/t/how-do-i-set-or-reset-the-web-interface-password/1328
Run the command pihole -a -p
I recommend using method 1 on the site below https://discourse.pi-hole.net/t/how-do-i-configure-my-devices-to-use-pi-hole-as-their-dns-server/245
goto http://pihole/admin if that doesn't work then try http://raspberrypi/admin
(This can be changed. Look up raspbian hostname)
Goto http://pihole/admin/gravity.php (http://raspberrypi/admin/gravity.php)
Here are some sources for lists
I prefer the command line for this
Follow the instructions to install this (see the command copied below) https://github.com/jacklul/pihole-updatelists
Install command
wget -O - https://raw.githubusercontent.com/jacklul/pihole-updatelists/master/install.sh | sudo bash
Run the commmand
pihole-updatelists --update && pihole-updatelists
To make things simpler to maintain we can add an alias to the .bashrc file located in the user directory
Install Vim sudo apt-get install vim
Then run
vim ~/.bashrc
Here's a quick rundown on how to use Vim https://coderwall.com/p/adv71w/basic-vim-commands-for-getting-started https://www.fosslinux.com/41731/a-beginners-guide-to-vim.htm
Press i
to enter into Insert Mode
copy and paste the following line at the top of the file (the && symbol executes the following command after the other command completes successfully)
alias update="sudo apt-get update && sudo apt-get upgrade -y && sudo pihole-updatelists --update && sudo pihole-updatelists"
Press Escape to enter into Command Mode
Type :wq
and press enter
(: is for command. w is for write/save. q is for quit)
After Vim closes exit the shell by typing exit
Reconnect
Run the new alias update
NOTE the command sudo gives root powers use with caution
updates the package cache
upgrades packages
disk space
Cleans the package cache
cleans up unused dependencies
https://blog.protoneer.co.nz/raspberry-pi-zero-footprint-dimensions/
Dimensions : 65 mm by 30 mm
4 mounting holes for M2.5 screws.
Mini-HDMI
Two Micro USB ports – One OTG USB and One Power USB.
One Micro SD card reader.
Raspberry Pi Zero Mounting holes : 58mm x 23mm
Add heat sink for heat mitigation