Using dnsmasq and Pi-Hole for DNS Services in the Network

All Screenshots are © of their respective owners. Visit The Web Design Museum for More Screenshots

internet-explorer-3-0-1996.gif

internet-explorer-3-0-1996.gif

internet-explorer-3-0-1996.gif

internet-explorer-3-0-1996.gif

msn-1999.jpg

internet-explorer-3-0-1996.gif

internet-explorer-3-0-1996.gif

internet-explorer-3-0-1996.gif

internet-explorer-3-0-1996.gif

internet-explorer-3-0-1996.gif

internet-explorer-3-0-1996.gif

internet-explorer-3-0-1996.gif

I know you're 🙄...

No one likes ads. Blocking almost all ads over the network was a distant dream. I had deployed my own DNS Service using dnsmasq back in Grade 10, but only for resolving my internal domains — cloud.atheesh.org, inside.atheesh.org, wan.atheesh.org, mediacenter.atheesh.org, etc.

Blocking so many ad-servers using dnsmasq by resolving those domains to 0.0.0.0 was next to impossible. Then I came to know about Pi-Hole, a wrapper around dnsmasq which just adds ad-lists from https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts to dnsmasq.conf. Although I could have grabbed the ad-list (a dnsmasq configuration file) and directly put it in my server, I didn't do so, the really beautiful user interface of Pi-Hole prevented me.

Thank Gravity-Sync, a Pi-Hole DNS Replication service. It helps me sync DNS Entries uniformly among all three Dynamic Name Servers — ns01.atheesh.org, ns02.atheesh.org and ns03.atheesh.org.

A DHCP Server?

As I mentioned earlier, I used to use dnsmasq for DNS Services. I also used to use it as a DHCP Server for all the clients in my network. (I made sure to disable my router's internal DHCP Server. You know what two DHCP Servers do when left improperly configured do...)

Why did I need one? To Resolve domains differently for different clients. I used the DHCP Service of dnsmasq to Group Clients (Called tagging in dnsmasq) and block certain websites for those specific groups (that is, resolving certain domains like youtube.com as 0.0.0.0 for all clients in that group).

Again Pi-Hole to the rescue. Pi-Hole could do the same thing without much complexity but by just using the source IP from DNS Request headers (again, it's a wrapper around dnsmasq with improvements) which dnsmasq couldn't do. I configured Pi-Hole to do the same and made my router the DHCP Server creating simplicity in the network.

Screenshots

image.png

Primary DNS

image.png

Secondary DNS

image.png

Tertiary DNS



Revision #10
Created 7 July 2022 08:40:46 by Atheesh
Updated 11 July 2022 09:40:35 by Atheesh