Skip to content

Can't sync time when time is incorrect due to dnssec #5873

Closed

Description

@sjoerd-ccu

Submission type

  • [x ] Bug report

systemd version the issue has been seen with

233

Used distribution

Debian

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.

Activity

  1. grawity commented on May 2, 2017

    @grawity
    Contributor

    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.)

  2. poettering commented on May 9, 2017

    @poettering
    Member

    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. added this to the v234 milestone on May 9, 2017
  4. keszybz commented on Jun 17, 2017

    @keszybz
    Member

    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.

  5. removed this from the v234 milestone on Jun 17, 2017
  6. sjoerdsimons commented on May 16, 2018

    @sjoerdsimons
    Contributor

    @keszybz Did you get any chacne to dig up that patch set ? :) (I just happened to hit this again)

  7. fuelflo commented on Aug 11, 2018

    @fuelflo

    @keszybz @poettering any progress with this one yet?

  8. ranolfi commented on Apr 18, 2019

    @ranolfi

    @keszybz Would you be willing to share the unfinished patch set? I can review it and maybe finish your work.

  9. nagualcode commented on Jun 24, 2019

    @nagualcode

    this is important

  10. gearhead commented on Mar 22, 2020

    @gearhead

    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.

  11. added a commit that references this issue on Jun 23, 2020
  12. DLGolden commented on Jun 28, 2020

    @DLGolden

    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.

  13. 10 remaining items

  14. added a commit that references this issue on Nov 18, 2020
  15. added 2 commits that reference this issue on Feb 12, 2021
    bdd84f4
    abf4e5c
  16. voidpointertonull commented on Nov 16, 2025

    @voidpointertonull

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions