The first connection is trust on first use: you accept the fingerprint and it is stored. If it later differs, ssh warns that the host identification has changed. Host names can be hashed with ssh-keygen -H.