Skip to content

Commit 08fc560

Browse files
committed
Change error levels
1 parent 65ada71 commit 08fc560

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

dnscrypt-proxy/plugin_forward.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,16 @@ func (plugin *PluginForward) Init(proxy *Proxy) error {
123123
}
124124
if requiresDHCP {
125125
if len(proxy.userName) > 0 {
126-
dlog.Warn("DHCP/DNS detection may not work when `user_name` is set or when starting as a non-root user")
126+
dlog.Warn("DHCP/DNS detection may not work when 'user_name' is set or when starting as a non-root user")
127127
}
128128
if proxy.SourceIPv6 {
129-
dlog.Info("Starting a DHCP/DNS detector for IPv6")
129+
dlog.Notice("Starting a DHCP/DNS detector for IPv6")
130130
d6 := &dhcpdns.Detector{RemoteIPPort: "[2001:DB8::53]:80"}
131131
go d6.Serve(9, 10)
132132
plugin.dhcpdns = append(plugin.dhcpdns, d6)
133133
}
134134
if proxy.SourceIPv4 {
135-
dlog.Info("Starting a DHCP/DNS detector for IPv4")
135+
dlog.Notice("Starting a DHCP/DNS detector for IPv4")
136136
d4 := &dhcpdns.Detector{RemoteIPPort: "192.0.2.53:80"}
137137
go d4.Serve(9, 10)
138138
plugin.dhcpdns = append(plugin.dhcpdns, d4)
@@ -188,15 +188,16 @@ func (plugin *PluginForward) Eval(pluginsState *PluginsState, msg *dns.Msg) erro
188188
for _, dhcpdns := range plugin.dhcpdns {
189189
inconsistency, ip, dhcpDNS, err := dhcpdns.Status()
190190
if err != nil && ip != "" && inconsistency > maxInconsistency {
191-
dhcpDNS = nil
191+
dlog.Infof("No response from the DHCP server while resolving [%s]", qName)
192+
continue
192193
}
193-
if len(dhcpDNS) > 0 {
194+
if dhcpDNS != nil && len(dhcpDNS) > 0 {
194195
server = net.JoinHostPort(dhcpDNS[rand.Intn(len(dhcpDNS))].String(), "53")
195196
break
196197
}
197198
}
198199
if len(server) == 0 {
199-
dlog.Warn("DHCP didn't provide any DNS server")
200+
dlog.Infof("DHCP didn't provide any DNS server to forward [%s]", qName)
200201
continue
201202
}
202203
}

0 commit comments

Comments
 (0)