# Confused about dnsmasq and PiHole setup

**URL:** <https://discourse.pi-hole.net/t/confused-about-dnsmasq-and-pihole-setup/34597>\
**Category:** Community Help\
**Created:** [June 18, 2020, 3:51pm UTC](https://discourse.pi-hole.net/t/confused-about-dnsmasq-and-pihole-setup/34597 "2020-06-18T15:51:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoWorries](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/n/8edcca/32.png) [@NoWorries](https://discourse.pi-hole.net/u/NoWorries)\
**Post date:** [June 18, 2020, 3:51pm UTC](https://discourse.pi-hole.net/t/confused-about-dnsmasq-and-pihole-setup/34597/1 "2020-06-18T15:51:30Z")

</div>

Apolgies if this is a dumb questions, I've searched around the web and can't find an answer which usually means the answer is obvious or it's a dumb question so apologies up front. I've installed PIHole and forced my laptop to use it as the DNS server. All looks good. I couldn't see the ability to define static ip addresses based on hardware address.

My question is how do I incorporate PiHole into my current LAN set up which includes dnsmasq?  
Do I ;  
a) drop dnsmasq completely  
b) dnsmasq passes traffic to pihole  
c) pihole passes traffic to dnsmasq

**Details about my system:**  
In my current setup dnsmasq is the dns server and provides dhcp and provides static ip address and host names for certain devices based on hardware addresses. e.g.  
dhcp-host=b8:88:a9:ee:24:fa,Wifipi,192.168.1.252

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [June 18, 2020, 4:21pm UTC](https://discourse.pi-hole.net/t/confused-about-dnsmasq-and-pihole-setup/34597/2 "2020-06-18T16:21:06Z")

</div>

If you decide to keep your existing _`dnsmasq`_, have it distribute your Pi-hole's IP address as the sole DNS server via DHCP, and configure Pi-hole to use your _`dnsmasq`_ instance as its sole upstream.  
That way, your clients would send their queries to Pi-hole, so you'd be able to associate queries to individual clients.

This is only guaranteed to work if you host _`dnsmasq`_ and Pi-hole on separate machines, lest they compete for control over port 53 as well as configuration options.

If you decide to replace your existing _`dnsmasq`_ with Pi-hole, you will be happy to learn that Pi-hole makes use of its own embedded version of _`dnsmasq`_ tailored to its specific needs.

This means you could install Pi-hole on a different machine and copy your existing _`dnsmasq`_ configuration to `/etc/dnsmasq.d/`.

You'd have to be careful to eliminate possible conflicts with configuration options controlled by Pi-hole itself.  
Pi-hole will store these in  
`01-pihole.conf` - general configuration, always present  
`02-pihole-dhcp.conf` - DHCP options, only present if Pi-hole is set as DHCP server  
`04-pihole-static-dhcp.conf` - definitions for DHCP lease reservations, again only present if Pi-hole is set as DHCP server

If your own configuration for your clients is pretty advanced, the latter one will be the most likely source of conflict.  
In that case, my advice would be to stay clear of using Pi-hole's UI to manage static IPs - stick with your files instead.

Note that Pi-hole may and will overwite its own files on UI interaction and/or any manual updates of Pi-hole (but _not_ during weekly updates of blocklists), while anything else will stay untouched. It's a good idea to keep vital things in a separate configuration file.

---

<div class="post-metadata">

**Author:** ![NoWorries](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/n/8edcca/32.png) [@NoWorries](https://discourse.pi-hole.net/u/NoWorries)\
**Post date:** [June 18, 2020, 4:44pm UTC](https://discourse.pi-hole.net/t/confused-about-dnsmasq-and-pihole-setup/34597/3 "2020-06-18T16:44:18Z")

</div>

Many Thanks Buckinhg Horn

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [June 18, 2020, 4:54pm UTC](https://discourse.pi-hole.net/t/confused-about-dnsmasq-and-pihole-setup/34597/4 "2020-06-18T16:54:47Z")

</div>

Pi-hole is based on dnsmasq, and if there is no compelling reason to have a separate dnsmasq instance running, you can have Pi-hole assume all the existing dnsmasq functions and eliminate the other instance. Any existing dnsmasq configuration files will work with pihole-FTL. You would put them in new files in /etc/dnsmasq.d on the Pi.
