DHCP Dynamic DNS update to pihole

Hi there,

there was a help request for pihole 4.x:

due to that topis ic closed, I want to "reopen" here - as I can see huge improvement in pihole 5, which should make life more easy;-)

Expected Behaviour:

I am running a OPNsense Firewall with DHCP there. This is must (until pihole can multi-arch-pxe :stuck_out_tongue:)
I activated dynamic dns updates to do registering DHCP-clients at DNS server.
Put in the DNS domain name and the dns server.
due to inside secured network, I do not have a password --> therefore api key is empty (so i do not put in any other setting to dhcp-server)

I am expecting, that my dhcp-leases should registered in pihole.

Actual Behaviour:

I am not really sure if this is working - need some assistance for checking/testing. Actually I am completely new to pihole, apprecciating any help :slight_smile:

Debug Token:

no debug now - will do later maybe

1 Like

This seems primarily like an issue for your OPNsense's DHCP server:
Only a DHCP server registers DHCP leases.
As long as Pi-hole is not your DHCP server, it won't register any DHCP leases.

If you want to make Pi-hole aware of the hostnames that a client tries to register with its DHCP server during DHCP negotiation, it would entirely depend on your DHCP server honoring those requests.
Certain DHCP servers may just discard this information (e.g. ISC) without additional configuration.

If your DHCP servers does honor client hostnames, it would again depend on how your DHCP server adds those entries into your local DNS. Most routers run their own DNS server, and hence a DHCP lease's hostname will get injected into that DNS server only.
I wouldn't know if OPNsense may or may not allow you to configure this.
This would be a question for OPNsense support.

Provided your DHCP server injects hostnames into its own DNS server, you could handle that through Pi-hole by
a) using your OPNsense DNS server as Pi-hole's sole upstream server
b) enabling Conditional Fowarding
c) configuring Custom DNS records for each of your devices

The latter would also be the only way to guarantee that you see exactly the name you want for a device on your network, as DNS allows to register multiple names for the same IP, and some devices may pick rather ugly random names for themselves (e.g. Android smartphones).

Hi,

thank you for your answer - i might was not very clear with my question.
my DHCP Server is the Firewall and I can see dhcp leases are also rechable via dns - thats the default setup - this is working.

what i want to do is:
There is a option to register leases on a different dns server (like in enterprise area - when dhcp and dns services are separated). I put in that option and just want to check in pihole, if the dhcp told to register.

I don't know pihole very well - thats the reason I'm asking for support here instead of hours of searching :slight_smile:

I found a screenshot on the net about what I mean:

1 Like

The picture you tried to link fails to show for me.

But independent from this, I've already given you the options for making Pi-hole aware of local hostnames as controlled by another device if Pi-hole is not running as DHCP server.

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