# Environment Variables for Pi-hole [![GitHub-logo.png](https://wiki.aeoneros.com/uploads/images/gallery/2024-09/scaled-1680-/Ot77lQOoFS2b2cPK-github-logo.png)](https://github.com/pi-hole/docker-pi-hole?tab=readme-ov-file#environment-variables)
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.
**DNSSEC**falseEnable DNSSEC support (`true` or `false`).
**DNS\_BOGUS\_PRIV**truePrevents forwarding reverse lookups for private ranges.
**DNS\_FQDN\_REQUIRED**truePrevents forwarding of non-FQDNs (Fully Qualified Domain Names).
**REV\_SERVER**falseEnables DNS conditional forwarding for local device name resolution.
**REV\_SERVER\_DOMAIN**unsetSet the domain of the local network router if conditional forwarding is enabled.
**REV\_SERVER\_TARGET**unsetIP of the local network router when conditional forwarding is enabled.
**REV\_SERVER\_CIDR**unsetReverse DNS zone (e.g., `192.168.0.0/24`) for conditional forwarding.
**DHCP\_ACTIVE**falseEnable DHCP server (`true` or `false`).
**DHCP\_START**unsetStart IP for DHCP server (if DHCP is enabled).
**DHCP\_END**unsetEnd IP for DHCP server (if DHCP is enabled).
**DHCP\_ROUTER**unsetRouter (gateway) IP for the DHCP server (if DHCP is enabled).
**DHCP\_LEASETIME**24Lease time for DHCP (in hours).
**PIHOLE\_DOMAIN**lanDomain name sent by the DHCP server.
**DHCP\_IPv6**falseEnable DHCP IPv6 support (`true` or `false`).
**DHCP\_rapid\_commit**falseEnable DHCPv4 rapid commit.
**VIRTUAL\_HOST**${HOSTNAME}Sets the virtual host for web access (e.g., `http://pi.hole/admin`).
**IPv6**trueDisables IPv6 configuration when set to `false` (helpful for Unraid).
**TEMPERATUREUNIT**cSets temperature unit (`c`: Celsius, `k`: Kelvin, or `f`: Fahrenheit).
**WEBUIBOXEDLAYOUT**boxedUse boxed or traditional layout for the web interface.
**QUERY\_LOGGING**trueEnables or disables query logging.
**WEBTHEME**default-lightUser interface theme (options: `default-dark`, `default-light`, `default-auto`, etc.).
**WEBPASSWORD\_FILE**unsetSet admin password via Docker secrets. Ignored if `WEBPASSWORD` is set.
### Advanced Variables
VariableDefault ValueDescription
**INTERFACE**unsetNIC interface for DNS or DHCP services.
**DNSMASQ\_LISTENING**unsetListening behavior (`local`, `all`, `single`).
**WEB\_PORT**unsetCustom web interface port (may affect the "blocked" page functionality).
**WEB\_BIND\_ADDR**unsetBind address for the web interface.
**SKIPGRAVITYONBOOT**unsetSkip updating Gravity Database on boot (set to `1` to skip).
**CORS\_HOSTS**unsetList of FQDNs allowed for CORS (comma-separated).
**CUSTOM\_CACHE\_SIZE**10000Sets cache size for `dnsmasq`. Ignored if DNSSEC is enabled.
**FTL\_CMD**no-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\_USER**unsetChange the user that `FTLDNS` runs as (`pihole` or `root`).
**PIHOLE\_UID**999Override Pi-hole's default user ID.
**PIHOLE\_GID**999Override Pi-hole's default group ID.
**WEB\_UID**33Override the `www-data` user ID.
**WEB\_GID**33Override the `www-data` group ID.
**WEBLOGS\_STDOUT**0Redirects web logs to stdout when set to `1`.