SSHFP records allow SSH host keys (see RFC 4253) to be published via the Domain Name Service. An interesting benefit is that, should SSHFP lookup be the only allowed method of authenticating a host key, keys can be revoked by removing them from DNS. They are defined in RFC 4255. It is resource record (RR) type 44 (0x2C).
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| algorithm | fp type | /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ /
/ /
/ fingerprint /
/ /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
SSHFP records can be looked up via dig -t sshfp:
[hoare](0) $ dig +short -t sshfp svn.research.sys 1 1 CC96EE17FF88BB18AC8994342AE2B24185BA1B26 [hoare](0) $
On FreeBSD, the dns/sshfp port supplies sshfp; Debian added the sshfp package 2008-07-13. This tool generates SSHFP output from ssh-keyscan or KnownHosts files:
[prometheus](0) $ /usr/local/bin/sshfp ctapd03.research.sys ctapd03.research.sys IN SSHFP 1 1 443e23a036005c581f4f3e2e5a7949091d7318cd ctapd03.research.sys IN SSHFP 2 1 86b505f00cb65359f6e377758b92359fc6dbd49b [prometheus](0) $ /usr/local/bin/sshfp [207.59.224.206]:7710. IN SSHFP 2 1 9eee5ceda25f86d4d9bf7f8569e576c56b69b9fc hoare.research.sys. IN SSHFP 1 1 cc96ee17ff88bb18ac8994342ae2b24185ba1b26 localhost IN SSHFP 1 1 46c7cec5dde1fa5647591fd8636087508defea91 providence.scur. IN SSHFP 1 1 cc96ee17ff88bb18ac8994342ae2b24185ba1b26 qemfd IN SSHFP 1 1 2626a74a1c42c15ad31da0ee187992606ce135e0 qemfd.net. IN SSHFP 1 1 2626a74a1c42c15ad31da0ee187992606ce135e0 svn.research.sys. IN SSHFP 1 1 cc96ee17ff88bb18ac8994342ae2b24185ba1b26 [prometheus](0) $
[recombinator](0) $ ssh-keygen -r qemfd.net qemfd.net IN SSHFP 1 1 2626a74a1c42c15ad31da0ee187992606ce135e0 qemfd.net IN SSHFP 2 1 4193db02ecc3acd85f9abbaf71c8945ebe7f6067 [recombinator](0) $
:qemfd.net:44:\001\001\046\046\247\112\034\102\301\132\323\035\240\356\030\171\222\140\154\341\065\340:
#!/usr/bin/perl
use strict;
open IN, "ssh-keygen -f /etc/ssh/ssh_host_rsa_key.pub -r $ARGV[0] |";
my $FP = <IN>;
close IN;
chop $FP;
my ($host, $in, $sshfp, $alg, $fptype, $fp) = split " ", $FP;
my $out = sprintf("\\%03o\\%03o", $alg, $fptype);
for (my $i = 0; $i < length($fp); $i += 2) {
$out .= sprintf("\\%03o", hex substr($fp, $i, 2));
}
printf(":%s:44:%s:\n", $host, $out);