Skip to content

wgbartley/dhcp-to-dns

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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-hole
  • pihole_protocol - The protocol (HTTP or HTTPS) used to access pi-hole
  • pihole_port - The TCP port pi-hole is listening on
  • pihole_password - Cleartext password you use to log in to pi-hole
  • pfsense_address - The DNS or IP address of pfSense
  • pfsense_protocol - The procotol (HTTP or HTTPS) used to access pfSense
  • pfsense_port - The TCP port pfSense is listening on
  • pfsense_client_id - The client ID for the pfSense API
  • pfsense_client_token - The client token for the pfSense API
  • domain - The top-level domain to append to DNS records. For example .lan will create records such as example.lan or myserver.lan

About

Get DHCP static leases from pfSense and create corresponding records in pi-hole DNS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published