Yes that’s what I am after.
Could you nslookup the machine’s hostname and then its IP address. After that just compare the results i.e. check if the hostnames and IP addresses match.