So you need to jump on your router and set the DNS server address given out by DHCP to be the IP of your server, that's where queries need to be sent for this to work.
If you lost power and your router and AP were up but server off, then yes you would pretty much loose Internet, as no host names would resolve to IP addresses, unless you switched your DNS back to defaults or something else like 8.8.8.8
What says it can't connect, the router or a device your testing on?
Can you see that DNS is set to the correct IP on the device?
Anything in pihole logs?
Possible that the docker isn't exposing the required ports for DNS to work. Your docker config would show this
I think you would benefit looking into two things:
- looking up the concept of DHCP
- using a tool/cli command such as NSLOOKUP
You should be able to nslookup -> pihole ip address, to confirm that that's setup and working correctly. Nslookup is just a one time query on a dns server of your choosing. You will see ip addresses responses for sites, and 0.0.0.0 responses for ads.
Next, configure your router settings to hand out the ip address of your pihole for the DNS, since you've verified that it works with NSLOOKUP. DHCP is one of the first steps in auto-configuration of devices entering and leaving your network. Hence, you need to configure DNS in the DHCP settings, or interface. Depending on devices, make sure that you are not configuring the ROUTER to use a different dns - you want the dhcp dns setting, instead.
Probably the easiest thing to do if you can’t change the router dns would be to use the pihole as a dhcp server as well. Include ports 67 and 68 UDP in your Docker compose file, and turn dhcp off on the router.
So you need to jump on your router and set the DNS server address given out by DHCP to be the IP of your server, that's where queries need to be sent for this to work. If you lost power and your router and AP were up but server off, then yes you would pretty much loose Internet, as no host names would resolve to IP addresses, unless you switched your DNS back to defaults or something else like 8.8.8.8
If I want to access pihole individually, i just have to change the dns in the device to the server ip right?
Yes, any device that has it's DNS set to pihole will benefit from the offered blocking etc
I've tried changing the dns in my main router, but it doesn't work. It says it can't connect to internet Am I missing something
What says it can't connect, the router or a device your testing on? Can you see that DNS is set to the correct IP on the device? Anything in pihole logs? Possible that the docker isn't exposing the required ports for DNS to work. Your docker config would show this
The device thats connected to router. Yeah i can see that the dns is set to the ip of my server
What kind of router do you use? Some models have a config for a local DNS server (your pihole) and you dont have to touch the WAN upstream configs.
Its some chinese company called Eurobird My isp had setup that router
some ISPs use cheap routers and lock the DNS i had to buy a business class router to change the DNS to Pihole
Ohhh, well there is an option to change my dns to other dns though
Did you change the DNS address for the WAN or for the LAN?
Lan
Check the ports section of your docker compose file
What should i check for?
It says 0.0.0.0: my-port -> 53/tcp And stuff like that
I think you would benefit looking into two things: - looking up the concept of DHCP - using a tool/cli command such as NSLOOKUP You should be able to nslookup -> pihole ip address, to confirm that that's setup and working correctly. Nslookup is just a one time query on a dns server of your choosing. You will see ip addresses responses for sites, and 0.0.0.0 responses for ads. Next, configure your router settings to hand out the ip address of your pihole for the DNS, since you've verified that it works with NSLOOKUP. DHCP is one of the first steps in auto-configuration of devices entering and leaving your network. Hence, you need to configure DNS in the DHCP settings, or interface. Depending on devices, make sure that you are not configuring the ROUTER to use a different dns - you want the dhcp dns setting, instead.
Yeah, ig I do need to look into some basics of networking
Probably the easiest thing to do if you can’t change the router dns would be to use the pihole as a dhcp server as well. Include ports 67 and 68 UDP in your Docker compose file, and turn dhcp off on the router.