Skip to content

Reduce DHCP DNS detector instances #2814

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

Merged
merged 1 commit into from
Mar 28, 2025
Merged

Conversation

lifenjoiner
Copy link
Member

Fix #2812.

Just starting the daemons is enough, as there will be messages indicating errors. Besides, some routers are not stable to response these requests.

case DHCP:
const maxInconsistency = 9
for _, dhcpdns := range plugin.dhcpdns {
inconsistency, ip, dhcpDNS, err := dhcpdns.Status()
if err != nil && ip != "" && inconsistency > maxInconsistency {
dlog.Infof("No response from the DHCP server while resolving [%s]", qName)
continue
}
if len(dhcpDNS) > 0 {
server = net.JoinHostPort(dhcpDNS[rand.Intn(len(dhcpDNS))].String(), "53")
break
}
}
if len(server) == 0 {
dlog.Infof("DHCP didn't provide any DNS server to forward [%s]", qName)
continue
}

@jedisct1 jedisct1 merged commit 8a4a479 into DNSCrypt:master Mar 28, 2025
1 check failed
@jedisct1
Copy link
Member

Thank you!

@lifenjoiner lifenjoiner deleted the dhcp branch March 28, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants