Hey there,
I want to add the DNS provided by the connected network automatically.
I need this, because I use Pi-Hole in networks such as hotel wifis, which need authentication via a website first. So far, so good. But if I try to reach that website, I am unable to do so, because the DNS request to the standard DNS server used by Pi-Hole get blocked, and I can not get the IP address.
If I want to obtain this IP, I have to disable Pi-Hole, enable dnsmasq and insert the network DNS by hand.
You can get the DNS provided by the network (a DNS hosted by the router, which is not blocked, to give you the IP address of the website to authenticate) by typing sudo dhcpcd -U eth0
.
This DNS should be added as the last option automatically (if you enable it) for Pi-Hole, if all of the other DNS servers are unavailable, or as the first, if I want it (to get fritz.box
for example, it has to be the first one)
The list should look like this:
8.8.8.8 #first dns
6.6.6.6 #second dns
192.168.0.1 #dns provided by network
or in reverse order:
192.168.0.1 #dns provided by network
8.8.8.8 #first dns
6.6.6.6 #second dns
So my wuestion is:
Is this possible to achieve, and if the answer is yes, how is it possible?