readme.md 2.45 KB
Newer Older
Deac Karns's avatar
Deac Karns committed
1

2 3
# Vagrant Pi-hole
The purpose of this project is to make the [Pi-hole DNS ad blocker](https://pi-hole.net/) more accessible for daily use on any network.
Deac Karns's avatar
Deac Karns committed
4 5 6 7 8 9 10 11 12 13 14 15 16

Clone this repository

Navigate to the cloned directory
```
cd pihole-local
```

Start the vagrant box
```
vagrant up
```

17
Reconfigure the pihole vagrant box
Deac Karns's avatar
Deac Karns committed
18 19 20 21
```
vagrant provision
```

22
------
23 24 25 26 27
## DNSMasq
**What is it?**

[dnsmasq](https://en.wikipedia.org/wiki/Dnsmasq) will allow you to create DNS records easily. Any record you add to the `dnsmasq.conf` file will be turned into a local DNS record after you provision the vagrant box.

28
------
29
## Begin Using Pi-hole
Deac Karns's avatar
Deac Karns committed
30

31
Before you can take advantage of the Pi-hole vagrant box you will need to tell your computer to use it as your DNS server.
Deac Karns's avatar
Deac Karns committed
32 33

macOs:
34 35 36
- Open `System Preferences` -> `Network` 
- click the `Advanced` button
- add the ip address to the DNS section
Deac Karns's avatar
Deac Karns committed
37

38
>by default the vagrant box uses the `172.16.0.53` ip address.
Deac Karns's avatar
Deac Karns committed
39

40

41
------
42 43 44 45 46
## Pi-hole Admin panel
If you have properly configured your computers `dns` entry, you should be able to go to the following address to view the Pi-hole admin panel:

[http://dns.pihole/admin](http://dns.pihole/admin)

47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
The password is `secret`...literally, its `secret`


# Advanced network configuration
> By default, this vagrant box is set to use a static ip address `172.16.0.53`. With some minor adjustments your can use a DHCP address that is provided
by a local DHCP server. This can be usefull if you want your pihole server and dnsmasq to be accessible by other computers on the same network.


### Network configuration
You will be prompted by vagrant and asked what network interface you would like to bridge
your connection to. This is important because the vagrant box needs to get an ip address from 
your connected network. 

>Select the network interface that connects to your local network that is serving DHCP

changing the following line in the `Vagrantfile` you can tell vagrant to use DHCP:
```
config.vm.network "private_network", ip: "172.16.0.53"
```
TO
```
config.vm.network "public_network"
```

### Switching Networks
Lets face it, you use more than one network if you use a laptop. In order to get the Pi-hole 
box to be on the same network as your laptop you will need to reconfigure the application each
time you switch networks.

This can be cumbersome and repetitive so it has been abstracted into a provisioning step. At any point,
you can re-provision the box to set up Pi-hole and the vagrant box with the appropriate network settings.