AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

Fallback DNS server in case of AGH downtime

Open maxauvy opened this issue 4 years ago • 6 comments

Prerequisites

  • [x] I am running the latest version
  • [x] I checked the documentation and found no answer
  • [x] I checked to make sure that this issue has not already been filed

Problem Description

Depending on various events, the machine hosting AdGuard Home may go down unexpectedly. Thus, devices connected to the network cannot query their DNS server (AGH). I use AGH as my DHCP server, as my ISP does not allow to change DNS configuration.

Proposed Solution

An ideal solution would be to be able to advertise (through DHCP?) a fallback DNS server (the one from the ISP, or any other DNS server), which would be used only if the primary server does not answer. Maybe something like dhcp-option=6,AGH_IP,SecondaryDNS_IP for dnsmasq?

Thanks a lot :)

maxauvy avatar Feb 14 '22 15:02 maxauvy

I use AGH as my DHCP server

An ideal solution would be to be able to advertise (through DHCP?)

If the DHCP server is down, then how would it advertise said DNS IPs?

agneevX avatar Feb 14 '22 16:02 agneevX

In any case, the docs mention the ability to override the DNS servers sent by DHCP.

But it would be of no use if your DHCP server is down.

agneevX avatar Feb 14 '22 16:02 agneevX

@maxauvy, hello. Unfortunately, it's not possible to use DHCP options for that. The thing is it's impossible to automatically determine why the server doesn't respond. The OS decides whether to use the secondary DNS server or not. To be honest I'm pretty sure such a scheme is not even foreseen by DNS.

EugeneOne1 avatar Feb 14 '22 16:02 EugeneOne1

Hello 😃

If the DHCP server is down, then how would it advertise said DNS IPs?

That shouldn't be a problem if the device has a valid DHCP lease. Of course if one switches on a device while the DHCP server is already down, there's no easy solution.

Thanks y'all for your answers!

maxauvy avatar Feb 15 '22 09:02 maxauvy

Well leases expire and its not prudent to depend upon them.

As I said, you can try setting multiple DNS servers in DHCP options and see whether the odds are in your favor when the DHCP server and the primary DNS server go down.

agneevX avatar Feb 15 '22 09:02 agneevX

@maxauvy, if there are no more questions, we'll close the issue. Feel free to start a discussion on the topic.

EugeneOne1 avatar Feb 15 '22 11:02 EugeneOne1