Please follow the below template, it will help us to help you!
Expected Behaviour:
Should pihole restartdns w/o options reparse setupVars.conf and update /etc/dnsmasq.d/01-pihole.conf?
How do I use the pihole CLI to reload after manually updating setupVars.conf?
Actual Behaviour:
pihole restartdns (w/o options) does not update /etc/dnsmasq.d/01-pihole.conf.
The Save button under DNS Settings seems to update /etc/dnsmasq.d/01-pihole.conf, but it's not obvious how to do this from the CLI. Similar to this question under Docker.
In general, you should not edit setupVars.conf manually.
Instead, run pihole -r with Reconfigure .
You may get away with restarting Pi-hole's DNS resolver via Settings | System or pihole restartdns, but Reconfigure may do more than just writing a value to setupVars.conf.
If you go down that road, don't complain if your Pi-hole doesn't behave as expected.
For a Pi-hole Docker container, it's different again:
Just change its environment variables and restart the container.
pihole -r is interactive. How do I programmatically change/update only the Upstream DNS Server(s)? The manual way, obviously, is through the web UI and clicking the Save button. There must be a CLI equivalent of this?
###############################################################################
# FILE AUTOMATICALLY POPULATED BY PI-HOLE INSTALL/UPDATE PROCEDURE. #
# ANY CHANGES MADE TO THIS FILE AFTER INSTALL WILL BE LOST ON THE NEXT UPDATE #
# #
# IF YOU WISH TO CHANGE THE UPSTREAM SERVERS, CHANGE THEM IN: #
# /etc/pihole/setupVars.conf #