Skip to content

Commit b2a1078

Browse files
authored
[client] Disable dnssec for systemd explicitly (#3831)
1 parent 43ae79d commit b2a1078

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

client/internal/dns/systemd_linux.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ const (
3030
systemdDbusSetDNSMethodSuffix = systemdDbusLinkInterface + ".SetDNS"
3131
systemdDbusSetDefaultRouteMethodSuffix = systemdDbusLinkInterface + ".SetDefaultRoute"
3232
systemdDbusSetDomainsMethodSuffix = systemdDbusLinkInterface + ".SetDomains"
33+
systemdDbusSetDNSSECMethodSuffix = systemdDbusLinkInterface + ".SetDNSSEC"
3334
systemdDbusResolvConfModeForeign = "foreign"
3435

3536
dbusErrorUnknownObject = "org.freedesktop.DBus.Error.UnknownObject"
37+
38+
dnsSecDisabled = "no"
3639
)
3740

3841
type systemdDbusConfigurator struct {
@@ -95,9 +98,13 @@ func (s *systemdDbusConfigurator) applyDNSConfig(config HostDNSConfig, stateMana
9598
Family: unix.AF_INET,
9699
Address: ipAs4[:],
97100
}
98-
err = s.callLinkMethod(systemdDbusSetDNSMethodSuffix, []systemdDbusDNSInput{defaultLinkInput})
99-
if err != nil {
100-
return fmt.Errorf("setting the interface DNS server %s:%d failed with error: %w", config.ServerIP, config.ServerPort, err)
101+
if err = s.callLinkMethod(systemdDbusSetDNSMethodSuffix, []systemdDbusDNSInput{defaultLinkInput}); err != nil {
102+
return fmt.Errorf("set interface DNS server %s:%d: %w", config.ServerIP, config.ServerPort, err)
103+
}
104+
105+
// We don't support dnssec. On some machines this is default on so we explicitly set it to off
106+
if err = s.callLinkMethod(systemdDbusSetDNSSECMethodSuffix, dnsSecDisabled); err != nil {
107+
log.Warnf("failed to set DNSSEC to 'no': %v", err)
101108
}
102109

103110
var (

0 commit comments

Comments
 (0)