title: What is the ServerIP env variable in docker hub's pihole/pihole used for?
body: <p>I'm testing this image for work: <a href="https://hub.docker.com/r/pihole/pihole/" rel="nofollow noreferrer">https://hub.docker.com/r/pihole/pihole/</a></p>
  
  <p>It has a mandatory env variable that must be set to the docker host's IP: $ServerIP.</p>
  
  <p>The only explanation it offers for why it must be set is: "to block ads fully".</p>
  
  <p>Setting it seems to change the IP that shows up in PiHole's web interface under <code>Settings --&gt; System --&gt; Pi-hole IPv4 address</code>.</p>
  
  <p>I tried setting the env variable to an arbitrary IP (1.1.1.1), and as far as I can tell, nothing broke - the web interface still starts up fine, and the dns server still resolves DNS queries fine.</p>
  
  <p>What exactly does this variable do? It must be important, since it's mandatory.</p>
  
  <p>My biggest concern is that my pi-hole is started using a docker-compose.yml file, and I don't want to hard-code the docker host IP into the docker-compose.yml file in case that IP ever changes.</p>
  
  <p>Update: Upon further research, it appears that pihole can run in several modes. The latest version defaults to <code>BLOCKINGMODE=NULL</code>, where <code>0.0.0.0</code> is returned to DNS queries. If you put it in <code>BLOCKINGMODE=IP</code>, it returns the <code>Pi-hole IPv4 address</code> in response to DNS queries. Can anyone confirm that this is the only thing the setting is used for?</p>