What is trustd on a Mac, and why does it connect to the internet?
In short: trustd is the part of macOS that decides whether a certificate can be trusted, for every app on the Mac. It connects to Apple and to certificate authorities to ask whether certificates have been revoked. It is essential: without it, secure connections and app checks can't be completed properly. Don't block it.
Apple's description: trustd "provides services for evaluating trust in certificates for all processes on the system" (man trustd).
What a certificate check is
Every secure connection starts with a certificate, a signed statement that says "this server really is example.com". Apps are signed with certificates too, which is how macOS knows who made them. Before relying on a certificate, the Mac checks two things: that it was issued by someone trustworthy, and that it hasn't been withdrawn since. Certificates do get withdrawn, or revoked, for example when a company's keys are stolen.
trustd does this checking for every app, so apps don't each need their own way of doing it.
Why it goes online
Checking whether a certificate was revoked means asking the authority that issued it. Apple lists addresses such as ocsp.apple.com, crl.apple.com and valid.apple.com, and some of certificate authority DigiCert, among those every Apple device must be able to reach for "certificate validation" (Apple). Those are the kinds of addresses you will see trustd contact.
Does it tell Apple what you do?
A fair question, since it checks the apps you open. Apple says these security checks have never included your Apple Account or the identity of your device, that it doesn't log IP addresses for Developer ID certificate checks, and that any IP addresses collected are removed from its logs (Apple).
Is it safe?
The genuine trustd is Apple's and lives at /usr/libexec/trustd, a folder protected by System Integrity Protection (Apple). You may also see trustdFileHelper next to it, which is part of the same service. To check where the running copy lives, type this in Terminal:
ps -ax -o comm | grep trustd
Should you block it?
No. With trustd cut off, the Mac can't finish its checks on certificates, and anything that relies on them, from secure websites to opening apps, can slow down or fail. If you're worried about what it sends, Apple's answer is above.
How Ranger handles it
Ranger never blocks trustd. It is one of a handful of macOS services, alongside the name resolver, push notifications, Gatekeeper and time sync, that other apps depend on, so Ranger leaves them alone even in its Block Everything mode. They still appear in Traffic, with every address they contacted, so you can see what trustd checks and when.
To see the rest of what your Mac talks to, start with our guide to seeing which apps use the internet.