DNS headache on self hosted server 🤦🏻‍♂️ reddit / selfhosted ---------------------------------------------------------------------- AhmedBarayez · 2023-11-18 14:17 I’m using mikrotik as my main router with ip 10.0.10.254 And I got a new desktop and turned it into proxmox server with ip 10.0.10.253 And installed adguard home to be my local dns server with ip of 10.0.10.250 and changed how it resolve hostnames by using 1.1.1.1 & 8.8.8.8 I also have another adguard server vm hosted on cloud with ip 190.190.190.200 for example Configured mikrotik to use adguard as my primary dns server & cloud as secondary in (ip>dns) But it only resolves hostnames when Allow remote requests is checked, when i uncheck it & remove my cloud dns vm it doesn’t resolve anything Also in adguard quiery log the only client ip is my miktotik 10.0.10.254 it should be my local devices ip What could be wrong? ---------------------------------------------------------------------- tech2but1 · 2023-11-18 14:46 > Configured mikrotik to use adguard as my primary dns server & cloud as secondary in (ip>dns) No you didn't, because it isn't primary and secondary, it is just a list of DNS servers and the results can come back from any of them. DNS doesn't have a fixed notion of "primary" and "secondary" or a failover method as such. First come first served, that's it really. > But it only resolves hostnames when Allow remote requests is checked, when i uncheck it & remove my cloud dns vm it doesn’t resolve anything What is "it" here? When allow remote requests is unchecked the router will not process external requests so this sounds normal. Not sure what you're expecting to happen? ---------------------------------------------------------------------- AhmedBarayez · 2023-11-18 14:59 >Also in adguard quiery log the only client ip is my miktotik 10.0.10.254 it should be my local devices ip Ok and what about this? ---------------------------------------------------------------------- tech2but1 · 2023-11-18 15:03 What about it? You configured the Mikrotik to use Adguard as its upstream DNS server. What would you expect Adguard to show? You need to stop and think about what you're doing here, everything seems to be doing exactly what you've told it to do. ---------------------------------------------------------------------- AhmedBarayez · 2023-11-18 15:20 It's really working, but not the way i need it to be, i need logs to be shown with clients ip address not mikrotik ip address ---------------------------------------------------------------------- tech2but1 · 2023-11-18 15:26 Like I said, it's working exactly how you have it set up according to how you have described it. If you want it to work differently then you need to set it up differently. Not sure what you're not getting. ---------------------------------------------------------------------- Vampire_Duchess · 2023-11-18 15:35 Yup is working fine because in that setup will be forwarding the DNS so the analytics will show the MikRotik. you need to read the documentation for AdguardHome so you get more aware about different setups, you may need to use reverse dns. The easy way is to make AdguardHome work as DHCP server and DNS server in that way you will have all the telemetry and stats in the dashboard. Just leave the MikRotik as gateway. ---------------------------------------------------------------------- Fluffer_Wuffer · 2023-11-18 16:47 DNS requests are chained, so if your PC queries your Mikrotik, then you Mikrotik queries adguard.. what gets logged, is the last step that made the connection to Adguard, in this case, you Mikrotik... If you want you PC IP to show, configure your DHCP to use your Adguard as DNS, then you PC will talk directly to it... At least, that is what it sounds to me.... if you've already done this. Then the issue is possible due to Source NAT from the Docker Host to Container.... is order to fix this, you need to bind the container directly to the Host network, or give it a dedicated IP. ---------------------------------------------------------------------- tech2but1 · 2023-11-18 16:48 I'm not the one having the issue. ---------------------------------------------------------------------- timothyclaypole · 2023-11-18 16:56 You are at risk of getting confused as to the purpose and use of DNS servers, NAT gateways, routers, etcetera. Your adguard server(s) will resolve DNS looks for any client that asks them. Clients only know about the existence of those adguard servers if they’ve been told about them. Thats done either through DHCP or by setting dns manually on clients. You need to figure out how you want to distribute your desired DNS settings to your clients. Most likely you want to reconfigure your mikrotic box to distribute the ip addresses of the two adguard boxes when it hands out DHCP addresses (assuming that the microtik box is acting as DHCP server in your network). The other rational solution here would be to disable DHCP on the microtik and enable adguard’s DHCP function - it’s up to you how to handle this but until every one of your clients is configured to use your adguards DNS servers you won’t get the logging you are looking for. ---------------------------------------------------------------------- Lancaster1983 · 2023-11-18 18:32 I think OP needs a better understanding of the basics of DNS. ---------------------------------------------------------------------- ToNIX_ · 2023-11-19 02:22 IP > DHCP Server > Networks > DNS Servers This is where you need to put your DNS servers so they're given to the clients (instead of your Mikrotik being used between your clients and your DNS servers).