#! /bin/bash

# remove host entry from ssh_known_hosts file. Also removes entry with
# IP of the host

ssh-keygen -R $1
ip=$(host $1 | sed -e 's/.*has address //')
if [[ ! "$ip" =~ NXDOMAIN ]]; then
    ssh-keygen -R $ip
fi
