You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't sync time when time is incorrect due to dnssec #5873
In case of bug report: Steps to reproduce the problem
On systems without an RTC battery (typical little arm devboards) I'm running into an interesting issue where on boot the system time is set to something reasonably by timesyncd (e.g. last recorded date/time) but can still be a few days or weeks of depending on when the board was last turned on.
Unfortunately, the time being wrong causes all DNS lookups via resolved to fail (invalid signatures) which means timesyncd can never contact an ntp server to correct time..
Not entirely sure what a proper solution could be here; Downgrading when getting expired certificates while the system isn't ntp synchronized could be one option ofcourse.
Reacted by Marc Ranolfi, YamashitaRen, Alexandre Bolelli, patrolez, Andrey Melentyev and Davide Madrisan
There's a bit of a chicken and egg problem here: you need dnssec for authenticating the time server name, but you need correct time for authenticating dnssec...
I figure timesyncd at least should turn off DNSSEC validation explicitly when doing lookups, to break this cycle. And for the other NTP servers implementations I figure a way out would be to make nss-resolve introduce an env var $NSS_RESOLVE_DISABLE_DNSSEC or so, which when set would make all lookups bypass DNSSEC...
3 years old and still no work around other than to disable DNSSEC? I am spinning my wheels on this one as well. All Pis and others w/o battery rtc will probably suffer from this.
I've been following this since I got my Raspberry PI 4 because it was a pain. But all most all of the articles I read said that disabling DNSSEC accross was a bad idea. If it wasn't for the PI not having a RTC the problem wouldn't exist. So I approached as strictly a work around issue and created a script to work around the problem. It only happens a boot, so why not just set the time before time sync is started.
Wondering if I'm missing something, or if the workaround regressed, but I'm once again in the odd situation of having a silly system which fails to synchronize time due to the block being off, and DNSSEC being enabled.
The setup is a not particularly heavily modified Ubuntu 24.04 environment configured to use systemd-resolved.
What's odd, that even avoiding systemd-timesyncd, and going straight for SYSTEMD_NSS_RESOLVE_VALIDATE=0 resolvectl query ntp.ubuntu.com shows ntp.ubuntu.com: resolve call failed: DNSSEC validation failed: signature-expired.
Some searching shows that SYSTEMD_NSS_RESOLVE_VALIDATE usage might require nss-resolve to be used in nsswitch.conf which is definitely not the default configuration in Ubuntu at least, but resolvectl doesn't even seem to check that config, presumably just going straight for systemd-resolved.
Guessing that maybe resolvectl doesn't actually support SYSTEMD_NSS_RESOLVE_VALIDATE as it's documented to be a part of nss-resolve, I also restarted systemd-timesyncd after changing nsswitch.conf to include nss-resolve, but could only observe the continued log spam of DNSSEC validation failures. The configuration of systemd-timesyncd doesn't appear to be the issue as Environment=SYSTEMD_NSS_RESOLVE_VALIDATE=0 is present.
A more generic approach like #34230 would have saved me (and others using different resolvers), but it's still odd that seemingly SYSTEMD_NSS_RESOLVE_VALIDATE=0 isn't working.
Activity
grawity commentedon May 2, 2017
Something like tlsdate or roughtime would be necessary to remain secure. (I think OpenBSD's ntpd will pick up the rough time from TLS as well.)
poettering commentedon May 9, 2017
There's a bit of a chicken and egg problem here: you need dnssec for authenticating the time server name, but you need correct time for authenticating dnssec...
I figure timesyncd at least should turn off DNSSEC validation explicitly when doing lookups, to break this cycle. And for the other NTP servers implementations I figure a way out would be to make nss-resolve introduce an env var $NSS_RESOLVE_DISABLE_DNSSEC or so, which when set would make all lookups bypass DNSSEC...
keszybz commentedon Jun 17, 2017
Right. I need to dig up and finalize my dnssec-mode-per-request patch set. Yet another reason to do that. But I don't think this is v234 material.
sjoerdsimons commentedon May 16, 2018
@keszybz Did you get any chacne to dig up that patch set ? :) (I just happened to hit this again)
fuelflo commentedon Aug 11, 2018
@keszybz @poettering any progress with this one yet?
ranolfi commentedon Apr 18, 2019
@keszybz Would you be willing to share the unfinished patch set? I can review it and maybe finish your work.
nagualcode commentedon Jun 24, 2019
this is important
gearhead commentedon Mar 22, 2020
3 years old and still no work around other than to disable DNSSEC? I am spinning my wheels on this one as well. All Pis and others w/o battery rtc will probably suffer from this.
systemd: Disable dnssec by default
DLGolden commentedon Jun 28, 2020
I've been following this since I got my Raspberry PI 4 because it was a pain. But all most all of the articles I read said that disabling DNSSEC accross was a bad idea. If it wasn't for the PI not having a RTC the problem wouldn't exist. So I approached as strictly a work around issue and created a script to work around the problem. It only happens a boot, so why not just set the time before time sync is started.
10 remaining items
Add resolved.conf to disable stub resolver and DNSSEC
Fix DNS resolving (#1004)
units: turn off DNSSEC validation when timesyncd resolves hostnames
units: turn off DNSSEC validation when timesyncd resolves hostnames
voidpointertonull commentedon Nov 16, 2025
Wondering if I'm missing something, or if the workaround regressed, but I'm once again in the odd situation of having a silly system which fails to synchronize time due to the block being off, and DNSSEC being enabled.
The setup is a not particularly heavily modified Ubuntu 24.04 environment configured to use systemd-resolved.
What's odd, that even avoiding systemd-timesyncd, and going straight for
SYSTEMD_NSS_RESOLVE_VALIDATE=0 resolvectl query ntp.ubuntu.comshowsntp.ubuntu.com: resolve call failed: DNSSEC validation failed: signature-expired.Some searching shows that SYSTEMD_NSS_RESOLVE_VALIDATE usage might require nss-resolve to be used in nsswitch.conf which is definitely not the default configuration in Ubuntu at least, but resolvectl doesn't even seem to check that config, presumably just going straight for systemd-resolved.
Guessing that maybe resolvectl doesn't actually support SYSTEMD_NSS_RESOLVE_VALIDATE as it's documented to be a part of nss-resolve, I also restarted systemd-timesyncd after changing nsswitch.conf to include nss-resolve, but could only observe the continued log spam of DNSSEC validation failures. The configuration of systemd-timesyncd doesn't appear to be the issue as
Environment=SYSTEMD_NSS_RESOLVE_VALIDATE=0is present.A more generic approach like #34230 would have saved me (and others using different resolvers), but it's still odd that seemingly
SYSTEMD_NSS_RESOLVE_VALIDATE=0isn't working.