Try using ssh-keyscan.