dhcp-to-dns
dhcp-to-dns
Get list of DHCP static reservations from pfSense and create corresponding DNS records in pi-hole.
Prerequisites
You must install and configure the API for pfSense (see https://github.com/jaredhendrickson13/pfsense-api).
Caveats
I couldn't find a documented pi-hole API for creating local DNS records, so this script relies on logging in via the pi-hole web interface using a cleartext password. I don't like it, but "it is what it is".
Configuration
Copy config.js.example
to config.js
and set the options below. Read any mention of "pi-hole" as "pi-hole web interface" and "pfsense" as "pfsense web interface".
pihole_address
- The DNS or IP address of pi-holepihole_protocol
- The protocol (HTTP or HTTPS) used to access pi-holepihole_port
- The TCP port pi-hole is listening onpihole_password
- Cleartext password you use to log in to pi-holepfsense_address
- The DNS or IP address of pfSensepfsense_protocol
- The procotol (HTTP or HTTPS) used to access pfSensepfsense_port
- The TCP port pfSense is listening onpfsense_client_id
- The client ID for the pfSense APIpfsense_client_token
- The client token for the pfSense APIdomain
- The top-level domain to append to DNS records. For example.lan
will create records such asexample.lan
ormyserver.lan
See more at [ github.com ]