How to Check a Server Name: hostname vs nslookup for Identifying Servers
Use hostname to ask a server what it calls itself; use nslookup to ask DNS what name or address the network publishes. That single difference solves most server identity checks. …