Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round robin DNS entries are not being rotated. #5049

Open
3 tasks done
hhaniel opened this issue Oct 19, 2022 · 6 comments
Open
3 tasks done

Round robin DNS entries are not being rotated. #5049

hhaniel opened this issue Oct 19, 2022 · 6 comments
Labels
feature request waiting for data Waiting for users to provide more data.

Comments

@hhaniel
Copy link

hhaniel commented Oct 19, 2022

Prerequisites

  • I have checked the Wiki and Discussions and found no answer

  • I have searched other issues and found no duplicates

  • I want to report a bug and not ask a question

Operating system type

Linux, Other (please mention the version in the description)

CPU architecture

x86

Installation

Docker

Setup

On one machine

AdGuard Home version

v0.107.12

Description

What did you do?

Round robin DNS name setup on upstream DNS server - eg DNS name points to 3 IP addresses.

Expected result

On every DNS query the IP address should get rotated and that happens on the upstream server running bind or for a DNS entry such as 0.pool.ntp.org

Actual result

AdGuard Home will return IP addresses in the same order on each query so no rotation or load balancing is taking place

Two queries against a standard bind DNS server for round robin:
Server: ns1
Address: 192.168.0.1#53

Name: time.localnet.lan
Address: 192.168.0.20
Name: time.localnet.lan
Address: 192.168.0.1
Name: time.localnet.lan
Address: 192.168.0.19

Server: ns1
Address: 192.168.0.1#53

Name: time.localnet.lan
Address: 192.168.0.19
Name: time.localnet.lan
Address: 192.168.0.20
Name: time.localnet.lan
Address: 192.168.0.1

Same two queries against AdGuard Home for round robin:
Server: ns0
Address: 192.168.0.216#53

Non-authoritative answer:
Name: time.localnet.lan
Address: 192.168.0.1
Name: time.localnet.lan
Address: 192.168.0.19
Name: time.localnet.lan
Address: 192.168.0.20

Server: ns0
Address: 192.168.0.216#53

Non-authoritative answer:
Name: time.localnet.lan
Address: 192.168.0.1
Name: time.localnet.lan
Address: 192.168.0.19
Name: time.localnet.lan
Address: 192.168.0.20

@jslawler-gh
Copy link

Hi there!

Are you still experiencing this?

@jslawler-gh jslawler-gh added the waiting for data Waiting for users to provide more data. label Mar 26, 2024
@hhaniel
Copy link
Author

hhaniel commented Mar 26, 2024

Yes still the case with v0.107.46 - It has something to do with the way the cache is handled. If I disable the cache I get the expected behaviour.

@EugeneOne1
Copy link
Member

@hhaniel, I feel there is a bit misunderstanding on what upstream mode "Load-balancing" does. The actual feature is about rotating the upstream servers used to resolve client's requests and not the upstream server's self addresses. Currently, the first successfully connected upstream's address is used, and cache has nothing to do with this. Could you please collect a verbose log for us? We'll file a separate issue if this unintended rotation will be confirmed.

However, considering this is a feature request.

@hhaniel
Copy link
Author

hhaniel commented Mar 26, 2024

Let me try to explain it in a way that can be reprroduced anywhere:
A DNS A record pointing to multible IP addresses is called a round robin DNS record. For example if you qery Googles DNS server on 8.8.8.8 for pool.ntp.org you will get something like:
Name: pool.ntp.org
Address: 134.0.16.1
Name: pool.ntp.org
Address: 129.250.35.251
Name: pool.ntp.org
Address: 213.170.135.207
Name: pool.ntp.org
Address: 162.159.200.123
Every subsequent query you will see the IP addresses being rotated so if I have a NTP config with three lines of pool.ntp.org I should end up pointing to 3 different servers. If I query the same against Adguard multible times I will always have the same IP address being returned at the top and the entries are not being rotated so starting NTP with the same config I will only end up with one server in my query list. So in my view it is not really a feature request - it is more of trying to archive standard DNS behaviour.

@EugeneOne1
Copy link
Member

@hhaniel, I see. According to the Cloudflare's article about round-robin DNS, this functionality is intended to be implemented on the side of an authoritative nameserver, not on the side of the forwarding resolver. It also mentions the drawbacks of caching the responses. AFAIK, there are no DNS standards that require this technique to be implemented on the resolver side, so we'd still consider this a feature request.

@hhaniel
Copy link
Author

hhaniel commented Mar 26, 2024

OK - well maybe it is not a standard but there is a RFC for it as well and most DNS forwarders respect round robin and handle it accordingly - certainly bind and dnsmasq do so a workaround for me is that I have put dnsmasq in front of AdGuard to do the in my view right thing. I would ask you to please consider it as a feature request though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request waiting for data Waiting for users to provide more data.
Projects
None yet
Development

No branches or pull requests

3 participants