Skip to main content

Environment Variables for Pi-hole

GitHub-logo.png

 

 

 

 

VariableDefault ValueDescription
PIHOLE_DNS_8.8.8.8;8.8.4.4Upstream DNS servers, separated by ;. Supports custom ports (e.g., 127.0.0.1#5053). DNS servers added via the web interface will be overwritten on restart.
DNSSECfalseEnable DNSSEC support (true or false).
DNS_BOGUS_PRIVtruePrevents forwarding reverse lookups for private ranges.
DNS_FQDN_REQUIREDtruePrevents forwarding of non-FQDNs (Fully Qualified Domain Names).
REV_SERVERfalseEnables DNS conditional forwarding for local device name resolution.
REV_SERVER_DOMAINunsetSet the domain of the local network router if conditional forwarding is enabled.
REV_SERVER_TARGETunsetIP of the local network router when conditional forwarding is enabled.
REV_SERVER_CIDRunsetReverse DNS zone (e.g., 192.168.0.0/24) for conditional forwarding.
DHCP_ACTIVEfalseEnable DHCP server (true or false).
DHCP_STARTunsetStart IP for DHCP server (if DHCP is enabled).
DHCP_ENDunsetEnd IP for DHCP server (if DHCP is enabled).
DHCP_ROUTERunsetRouter (gateway) IP for the DHCP server (if DHCP is enabled).
DHCP_LEASETIME24Lease time for DHCP (in hours).
PIHOLE_DOMAINlanDomain name sent by the DHCP server.
DHCP_IPv6falseEnable DHCP IPv6 support (true or false).
DHCP_rapid_commitfalseEnable DHCPv4 rapid commit.
VIRTUAL_HOST${HOSTNAME}Sets the virtual host for web access (e.g., http://pi.hole/admin).
IPv6trueDisables IPv6 configuration when set to false (helpful for Unraid).
TEMPERATUREUNITcSets temperature unit (c: Celsius, k: Kelvin, or f: Fahrenheit).
WEBUIBOXEDLAYOUTboxedUse boxed or traditional layout for the web interface.
QUERY_LOGGINGtrueEnables or disables query logging.
WEBTHEMEdefault-lightUser interface theme (options: default-dark, default-light, default-auto, etc.).
WEBPASSWORD_FILEunsetSet admin password via Docker secrets. Ignored if WEBPASSWORD is set.

Advanced Variables

VariableDefault ValueDescription
INTERFACEunsetNIC interface for DNS or DHCP services.
DNSMASQ_LISTENINGunsetListening behavior (local, all, single).
WEB_PORTunsetCustom web interface port (may affect the "blocked" page functionality).
WEB_BIND_ADDRunsetBind address for the web interface.
SKIPGRAVITYONBOOTunsetSkip updating Gravity Database on boot (set to 1 to skip).
CORS_HOSTSunsetList of FQDNs allowed for CORS (comma-separated).
CUSTOM_CACHE_SIZE10000Sets cache size for dnsmasq. Ignored if DNSSEC is enabled.
FTL_CMDno-daemonCustomize dnsmasq options (e.g., no-daemon -- --dns-forward-max 300).
FTLCONF_[SETTING]unsetCustomize pihole-FTL.conf settings (e.g., FTLCONF_LOCAL_IPV4).

Experimental Variables

VariableDefault ValueDescription
DNSMASQ_USERunsetChange the user that FTLDNS runs as (pihole or root).
PIHOLE_UID999Override Pi-hole's default user ID.
PIHOLE_GID999Override Pi-hole's default group ID.
WEB_UID33Override the www-data user ID.
WEB_GID33Override the www-data group ID.
WEBLOGS_STDOUT0Redirects web logs to stdout when set to 1.