PiHole in docker container + Enabeling PXE Boot Server

Hi Forum,

I am running Pi-Hole on my server in a container and want to set up a pxe boot server on order to boot linux Kali.
However, I am new to pi hole and docker. Before I used pihole I was using dnsmasq directly on the server and was able to set it up using this manual https://www.kali.org/docs/installation/network-pxe/

In order to do the same with pihole, how would i do it to add those lines to the dnsmasq.conf?

Pi-hole has dnsmasq included and can use all of its config options. Create a new file in etc/dnsmasq.d/ with the options you want and restart pihole.

When creating a custom dnsmasq configuration as suggested by yubiuser, you want to make sure that your options do not conflict with Pi-hole's own.

For the sample from your link, that would probably mean you'd have to strip all lines with interface, dhcp-range and dhcp-option for a start, as those are controlled via Pi-hole's UI.
If you'd need some of those options to coexist with Pi-hole's, you'd have to figure that out for yourself. Refer to dnsmasq's documentation for further option details.

Ok, so if I understand that correctly. I just create a file and call it pxeboot.conf consisting only the tftp server and other pxe configs for dnsmasq. Mount that in the container to /etc/dnsmasq.d/. Then I create mount the necessary files for kali linux in the container and should be good to go?

If that works, is there a way that I could write a small manual for that to be used in the pihole documentation?

I would assume that the dhcp options 3 ( router ) and 6 (dns) is pointing to the pihole in the standard configuration?

Some pointers:

pi@ph5b:~ $ pihole-FTL dhcp-discover
Scanning all your interfaces for DHCP servers
Timeout: 10 seconds

* Received 312 bytes from eth0:10.0.0.2
[..]
   dns-server: 10.0.0.2
   router: 10.0.0.1
[..]
pi@ph5a:~ $ cat /etc/dnsmasq.d/02-pihole-dhcp.conf
[..]
dhcp-option=option:router,10.0.0.1
[..]
pi@ph5b:~ $ man dnsmasq
[..]
       -O,  --dhcp-option=[tag:<tag>,[tag:<tag>,]][encap:<opt>,][vi-encap:<en‐
       terprise>,][vendor:[<vendor-class>],][<opt>|option:<opt-name>|op‐
       tion6:<opt>|option6:<opt-name>],[<value>[,<value>]]
              Specify different or extra options to DHCP clients. By  default,
              dnsmasq sends some standard options to DHCP clients, the netmask
              and broadcast address are set to the same as  the  host  running
              dnsmasq, and the DNS server and default route are set to the ad‐
              dress of the machine running dnsmasq.  (Equivalent  rules  apply
              for IPv6.)
pi@ph5a:~ $ pihole-FTL -- --help dhcp
Known DHCP options:
[..]
  3 router
[..]
  6 dns-server
[..]

Sounds good. I think I have figured it out. Will test and follow up.

It works. Kali Linux and SystemRescueCD is running over PSX. Where I can document what I did to make it easier for others?

Document it here.

If you want to get it included here

https://docs.pi-hole.net/

You need to make a pull request to the repo

(Note: there is no guarantee that it will be approved and included)

Sounds good. I created a pull request. Lets hope that helps others to find a solution faster.

I will add some other distributions to deploy via PXE Boot soon. Have already Linux Mint running.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.