Information about hostnames

Windows 10:
the hostname is stored in the registry hive
   HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName

query the hostname on Windows 10:

   cmd:
   reg query Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName / ComputerName

or

   cmd:
   ipconfig /ALL | findstr /I hostname             ( /I ignore upper and lower case )

or
   powershell:
   hostname
   or
   [Environment]::MachineName


Linux:
the hostname is sored in
   /etc/hostname
   /etc/sysconfig/network
   /etc/hosts                                                         ( if your computer has a fixed ip address )

query hostname on linux:

   hostname
   hostname -f                                                      ( fully qualified domainname, FQDN )