The short version

  • A DNSSEC-authenticated SSHFP match ties one presented SSH host-key algorithm and fingerprint to one selected DNS owner name. It does not prove that name was the service you meant, and it encodes no port, user or command.
  • The real decision is a chain: name selection, DNSSEC state, exact algorithm and digest comparison, proof of key possession, and local client policy. Host-key rotation adds a second clock ticking across DNS caches.

A perfect answer to a question nobody asked

Nothing in the connection was forged. The resolver picked a fully qualified name. A validating path signed off on its SSHFP RRset. The SSH server proved it held the private key behind the fingerprint in that record. Every check passed—and the operator was still standing on the wrong machine.

The missing predicate sits one step earlier, in the part nobody logs: why was that owner name the right expansion of db?

RFC 4255 saw this coming. When clients use unqualified names, it recommends checking a local host-key database before trusting SSHFP, because an attacker can inject a resolver search path and steer the client to a different host. A trusted search path is another defense—but ordinary lookup interfaces rarely show where that path came from.

DNSSEC can make an answer authentic without making the question wise. A useful trace keeps the original command-line label, the effective canonical name, any CNAME decision, the queried SSHFP owner and the final address as separate facts. Collapse them into “host” and you erase the exact point where intent was swapped out.

Three values, one narrow association

SSHFP is DNS resource-record type 44. Its RDATA holds a public-key algorithm number, a fingerprint type and the fingerprint. The owner name lives in the DNS record, outside that RDATA.

Verification needs both dimensions to agree. The algorithm of the public key the SSH server presents must match the SSHFP algorithm number. The digest of the public-key blob, computed with the registered fingerprint algorithm, must match the fingerprint bytes in the record.

That comparison does not replace SSH key exchange. The transport layer still requires the server to sign exchange material with the host key, proving control of the matching private key for that session. Nor does possession prove exclusivity: a copied or stolen private key produces the same valid proof.

The record format also advertises its own omissions. It carries no TCP port, username, command, IP address, organizational role or validity interval. A matching record for host.example cannot tell you whether the operator meant port 22, a second SSH daemon on another port, a jump host, a production role or an administrative account.

Secure is a validation state, not a mood

RFC 4255 is blunt: a key verified by SSHFP must not be trusted when the record used for verification was not authenticated by a trusted DNS signature. A client that validates locally follows DNSSEC validation procedures. A client that outsources validation needs a protected channel to the validator—accepting an asserted result bit across an untrusted path just relocates the attack.

Operations need the actual DNSSEC state. Secure means the data validated through an accepted trust anchor. Insecure means the chain establishes the data is not secured. Bogus means validation was expected and failed. Indeterminate means the available trust information cannot support a determination.

Those are not interchangeable flavors of “DNS returned something.” A byte-for-byte SSHFP match under Insecure has informational value but earns no automatic trust under RFC 4255. Bogus should never be quietly downgraded to Insecure. Indeterminate should surface the missing trust context.

Even Secure stays bounded. DNSSEC authenticates the RRset under its owner name and chain. It does not prove that a DHCP-derived suffix, a canonicalization rule or a hand-typed alias expressed the destination the user had in mind.

Algorithm agility needs a negative rule

The current IANA SSHFP registry assigns public-key algorithm numbers for RSA, DSA, ECDSA, Ed25519 and Ed448, and fingerprint type 1 to SHA-1 and type 2 to SHA-256. Registration says how a record is represented; it does not prove a given client implements or enables that combination.

RFC 6594 supplies the downgrade test that matters. An SSHFP-aware implementation that supports SHA-256 must prefer it when SHA-1 and SHA-256 records coexist. If the SHA-256 fingerprint is tested and mismatches the received key, the client must reject the key rather than rescue it with a matching SHA-1 record.

That rule preserves the subject of the failure. A stronger record that disagrees is not an invitation to hunt for any weaker fact that says yes. Telemetry therefore needs every tested tuple—owner, key algorithm, fingerprint type, computed digest and result—not a single sshfp=match flag.

Local policy still owns the final branch

RFC 4255 deliberately lets clients order SSHFP, local files and future verification methods through configurable policy. Current OpenSSH documentation makes the choice visible. VerifyHostKeyDNS defaults to no. With yes, OpenSSH implicitly trusts a key that matches a secure DNS fingerprint, while insecure fingerprints are treated like ask. With ask, match information is displayed, but acceptance of a new key still follows StrictHostKeyChecking.

The same client also carries user and global known-host databases, hostname canonicalization, permitted CNAME rules and host-key update behavior. Turning on SSHFP rewrites part of that decision graph. It does not erase conflicting pins or prove which branch actually ran.

A useful incident record therefore captures the resolved configuration, not the file an operator expected to match. Command-line options, user config, system config, Host and Match clauses, canonicalization and first-value precedence can each produce a different effective policy.

Port and path live outside the record

OpenSSH’s known-host maintenance can distinguish [hostname]:port. Its SSHFP generation command emits a record named by hostname alone. That is executable proof of a structural difference: a local pin database can carry a port-qualified identity, while SSHFP RDATA cannot.

The absence does not make SSHFP defective. It defines the unit it authenticates. If one DNS name serves different SSH host keys on different ports, application policy must decide whether that arrangement is valid and how each service is pinned. Pretending the DNS match selected the port grants the record authority it never contained.

A jump route piles on more names and keys. Authenticating the final destination does not authenticate a separately operated bastion just because traffic passes through it. Every material SSH transport leg needs its own host-key evidence and policy result.

Rotation is a two-clock operation

RFC 4255 notes that replacing SSHFP can distribute a new host key, and that—where policy requires SSHFP—removing a record can participate in revocation. Both depend on running client policy.

DNS adds time. Old RRsets linger in recursive caches until their TTLs expire, and their RRSIG validity has its own interval. SSH clients may also keep local known-host pins. Change the daemon’s host key before the new fingerprint is visible and you earn avoidable rejections. Delete the old fingerprint at the authoritative server and you have not proven every resolver stopped returning it.

A safe rotation publishes the new fingerprint through the authenticated enrollment path, watches it through material validating resolvers, overlaps old and new keys for a bounded period, switches service presentation, then removes the old record and proves refusal after the relevant caches expire. Emergency compromise may demand faster refusal and accepted unavailability—a named risk decision, not a license to call stale caches current.

Server identity is not user authority

SSH architecture separates server authentication in the transport layer from user authentication. An accepted host key protects the channel to the selected server. It does not authenticate the person or workload connecting, accept a user public key, grant a shell, permit port forwarding or authorize a command.

This is the final promotion error. Automation loves to treat “SSH host verified” as permission to deploy, rotate secrets or run privileged maintenance. Those actions need their own account identity, authorization policy, change scope and transaction record. A correct SSHFP decision can sit right in front of a denied login or a forbidden command without any contradiction.

Negative tests that keep every noun

Resolve the same short label under two search paths and require the different owner names to stay visible. Test an exact fingerprint match under Secure, Insecure, Bogus and Indeterminate. Publish SHA-1 and SHA-256 fingerprints, make only the stronger record mismatch, and require rejection.

Rotate keys across pre-publication, overlap, authoritative deletion and cache expiry. Connect to two ports with different host keys. Force a conflict between a local pin and a new Secure SSHFP match. Pass through a jump host. Copy the private host key to a second endpoint. Authenticate the server, then separately fail the user and the requested command.

The point is not universal rejection. It is to make every pass state which name, RRset, trust anchor, key, port, transport leg, client policy and later permission actually earned it. A fingerprint that matches is only the beginning of the sentence—never the whole verdict.