Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # @laptop
- cd ~
- wget https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-11-08/2021-10-30-raspios-bullseye-armhf-lite.zip -O raspbian_lite_latest.zip
- zipinfo raspbian_lite_latest.zip
- unzip raspbian_lite_latest.zip
- lsblk
- umount /media/dehakkelaar/rootfs /media/dehakkelaar/boot
- sudo dd status=progress bs=4M conv=fsync if=2021-10-30-raspios-bullseye-armhf-lite.img of=/dev/sdb
- sync
- rm 2021-10-30-raspios-bullseye-armhf-lite.img
- lsblk
- sudo mount /dev/sdb1 /mnt/tmp
- sudo touch /mnt/ssh
- sudo umount /mnt
- sudo mount /dev/sdb2 /mnt
- sudo nano /mnt/tmp/etc/dhcpcd.conf
- "
- [..]
- interface eth0
- static ip_address=10.0.0.4/24
- static routers=10.0.0.1
- static domain_name=home.dehakkelaar.nl
- static domain_name_servers=10.0.0.1
- "
- sync
- sudo umount /mnt
- ping 10.0.0.4
- ssh pi@10.0.0.4 # pi / raspberry
- # @Raspberry Pi
- passwd
- sudo dpkg-reconfigure tzdata
- sudo hostnamectl set-hostname ph5b
- sudo sed -i 's/^127.0.1.1/#127.0.1.1/' /etc/hosts
- sudo tee -a /etc/hosts <<< "127.0.1.1 $(hostname).home.dehakkelaar.nl $(hostname)"
- sudo systemctl disable alsa-restore alsa-state avahi-daemon.service wpa_supplicant
- sudo systemctl stop alsa-restore alsa-state avahi-daemon.service wpa_supplicant
- ssh-keygen
- nano ~/.ssh/authorized_keys2
- tee ~/.bash_aliases <<< $"alias ll='ls -al --color'"
- . ~/.bash_aliases
- sudo apt update && sudo apt upgrade
- sudo reboot
- ping 10.0.0.4
- ssh pi@10.0.0.4
- timedatectl
- hostname
- hostname -f
- dnsdomainname
- hostname -i
- hostname -I
- sudo apt install apt-file dnsmasq-base mc nmap screen tcpdump tree whois
- sudo apt-file update
- curl -sSL https://install.pi-hole.net | bash
- pihole -a -p
- sudo tee /etc/dnsmasq.d/10-dhcp-dns.conf <<< $'dhcp-option=option:dns-server,0.0.0.0,0.0.0.0,0.0.0.0'
- pihole-FTL --test
- sudo service pihole-FTL reload
- pihole status
- host ph5b ph5b
- host pi.hole $(hostname -i)
- host pi.hole $(hostname -I)
- host flurry.com $(hostname -I)
- host pi-hole.net $(hostname -I)
- curl -I http://$(hostname -i)/admin/
- nc localhost 4711 <<< $'>stats >quit'
- sudo apt install unbound
- sudo systemctl disable unbound-resolvconf
- sudo sed -i 's\^unbound_conf=\#unbound_conf=\g' /etc/resolvconf.conf
- sudo rm /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf
- sudo service dhcpcd restart
- sudo nano /etc/unbound/unbound.conf.d/pi-hole.conf
- "
- server:
- # If no logfile is specified, syslog is used
- # logfile: "/var/log/unbound/unbound.log"
- verbosity: 0
- interface: 127.0.0.1
- port: 5335
- do-ip4: yes
- do-udp: yes
- do-tcp: yes
- # May be set to yes if you have IPv6 connectivity
- do-ip6: no
- # You want to leave this to no unless you have *native* IPv6. With 6to4 and
- # Terredo tunnels your web browser should favor IPv4 for the same reasons
- prefer-ip6: no
- # Use this only when you downloaded the list of primary root servers!
- # If you use the default dns-root-data package, unbound will find it automatically
- #root-hints: "/var/lib/unbound/root.hints"
- # Trust glue only if it is within the server's authority
- harden-glue: yes
- # Require DNSSEC data for trust-anchored zones, if such data is absent, the zone becomes BOGUS
- harden-dnssec-stripped: yes
- # Don't use Capitalization randomization as it known to cause DNSSEC issues sometimes
- # see https://discourse.pi-hole.net/t/unbound-stubby-or-dnscrypt-proxy/9378 for further details
- use-caps-for-id: no
- # Reduce EDNS reassembly buffer size.
- # Suggested by the unbound man page to reduce fragmentation reassembly problems
- edns-buffer-size: 1472
- # Perform prefetching of close to expired message cache entries
- # This only applies to domains that have been frequently queried
- prefetch: yes
- # One thread should be sufficient, can be increased on beefy machines. In reality for most users running on small networks or on a single machine, it should be unnecessary to seek performance enhancement by increasing num-threads above 1.
- num-threads: 1
- # Ensure kernel buffer is large enough to not lose messages in traffic spikes
- so-rcvbuf: 1m
- # Ensure privacy of local IP ranges
- private-address: 192.168.0.0/16
- private-address: 169.254.0.0/16
- private-address: 172.16.0.0/12
- private-address: 10.0.0.0/8
- private-address: fd00::/8
- private-address: fe80::/10
- "
- sudo tee /etc/unbound/unbound.conf.d/remote-control.conf <<< $'remote-control:\n control-enable: yes'
- sudo service unbound restart
- sudo reboot
- cat /etc/resolv.conf
- dig +short @localhost -p 53 chaos txt version.bind
- dig +short @localhost -p 53 chaos txt servers.bind
- dig +short @localhost -p 5335 chaos txt version.bind
- dig +noall +comments +answer @localhost -p 5335 sigfail.verteiltesysteme.net
- dig +noall +comments +answer @localhost -p 5335 sigok.verteiltesysteme.net
- dig +short @localhost -p 5335 in a pi-hole.net
- sudo unbound-control list_forwards
- sudo unbound-control lookup pi-hole.net
- # http://10.0.0.4/admin/settings.php?tab=dns
- # Custom 1 (IPv4): 127.0.0.1#5335
- host pi-hole.net $(hostname -I)
Advertisement
Add Comment
Please, Sign In to add comment