Log the actual server IP

This commit is contained in:
Frank Denis 2025-01-10 23:02:41 +01:00
parent 5aa958e282
commit 956f16c107
2 changed files with 2 additions and 5 deletions

View file

@ -1,3 +1,2 @@
darpa.mil 208.67.222.222
download.windowsupdate.com $DHCP
download.windowsupdate.com $BOOTSTRAP

View file

@ -178,10 +178,8 @@ func (plugin *PluginForward) Eval(pluginsState *PluginsState, msg *dns.Msg) erro
switch item.typ {
case Explicit:
server = item.servers[rand.Intn(len(item.servers))]
pluginsState.serverName = server
case Bootstrap:
server = plugin.bootstrapResolvers[rand.Intn(len(plugin.bootstrapResolvers))]
pluginsState.serverName = "[BOOTSTRAP]"
case DHCP:
const maxInconsistency = 9
for _, dhcpdns := range plugin.dhcpdns {
@ -198,8 +196,8 @@ func (plugin *PluginForward) Eval(pluginsState *PluginsState, msg *dns.Msg) erro
dlog.Warn("DHCP didn't provide any DNS server")
continue
}
pluginsState.serverName = "[DHCP]"
}
pluginsState.serverName = server
if len(server) == 0 {
continue
}