How to add the network DNS?

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 for example, it has to be the first one)

The list should look like this: #first dns #second dns #dns provided by network

or in reverse order: #dns provided by network #first dns #second dns

So my wuestion is:
Is this possible to achieve, and if the answer is yes, how is it possible?

Pi-hole does not support dynamic upstreams. It is made to run on a server in a network that you control.

you have to either manually set your upstream or use conditional forwarding either way. you will have to set this Manually … I recommend using the Conditional Forwarding since it lets you pull just one domain out.

Ok, I think, I have an idea to manage this problem… Because I have another topic, which will be solved by the same solution, I will write the solution only in the other thread: Remove specific domain from statistics

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.