1
0
mirror of https://github.com/pi-hole/docker-pi-hole.git synced 2024-06-21 06:56:53 +02:00

Merge pull request #981 from pi-hole/new/PIHOLE_DNS_-source-of-truth

If PIHOLE_DNS_ env var is employed, use that as source of truth
This commit is contained in:
Adam Warner 2022-01-09 21:24:10 +00:00 committed by GitHub
commit 6262433f4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -94,7 +94,7 @@ There are other environment variables if you want to customize various things in
| Variable | Default | Value | Description |
| -------- | ------- | ----- | ---------- |
| `ADMIN_EMAIL` | unset | email address | Set an administrative contact address for the Block Page |
| `PIHOLE_DNS_` | `8.8.8.8;8.8.4.4` | IPs delimited by `;` | Upstream DNS server(s) for Pi-hole to forward queries to, seperated by a semicolon <br/> (supports non-standard ports with `#[port number]`) e.g `127.0.0.1#5053;8.8.8.8;8.8.4.4` |
| `PIHOLE_DNS_` | `8.8.8.8;8.8.4.4` | IPs delimited by `;` | Upstream DNS server(s) for Pi-hole to forward queries to, seperated by a semicolon <br/> (supports non-standard ports with `#[port number]`) e.g `127.0.0.1#5053;8.8.8.8;8.8.4.4` Note: The existence of this environment variable assumes this as the _sole_ management of upstream DNS. Upstream DNS added via the web interface will be overwritten on container restart/recreation |
| `DNSSEC` | `false` | `<"true"\|"false">` | Enable DNSSEC support |
| `DNS_BOGUS_PRIV` | `true` |`<"true"\|"false">`| Never forward reverse lookups for private ranges |
| `DNS_FQDN_REQUIRED` | `true` | `<"true"\|"false">`| Never forward non-FQDNs |

View File

@ -115,7 +115,10 @@ fi
# Parse the PIHOLE_DNS variable, if it exists, and apply upstream servers to Pi-hole config
if [ -n "${PIHOLE_DNS_}" ]; then
echo "Setting DNS servers based on PIHOLE_DNS_ variable"
# Remove any PIHOLE_DNS_ entries from setupVars.conf, if they exist
sed -i '/PIHOLE_DNS_/d' setupVars.conf
# Split into an array (delimited by ;)
# Loop through and add them one by one to setupVars.conf
PIHOLE_DNS_ARR=(${PIHOLE_DNS_//;/ })
count=1
valid_entries=0