Most direct way to find out what is happening is to use,
$ env _CONDOR_TOOL_DEBUG=D_HOSTNAME condor_config_val -debug FULL_HOSTNAME
(or if you’re running a version before 7.4.4 or 7.5.4, where -debug was fixed (#1541) for condor_config_val, use condor_status -debug -total)
You will get some output similar to,
$ _CONDOR_ALL_DEBUG=D_HOSTNAME condor_config_val -debug -dump | grep -e ^HOSTNAME -e ^FULL_HOSTNAME -e ^IP_ADDRESS 07/28 13:48:44 Finding local host information, calling gethostname() 07/28 13:48:44 gethostname() returned a host with no domain "eeyore" 07/28 13:48:44 Trying to find full hostname and IP addr for "eeyore" 07/28 13:48:44 Calling gethostbyname(eeyore) 07/28 13:48:44 Found IP addr in hostent: 127.0.0.1 07/28 13:48:44 Trying to find full hostname from hostent 07/28 13:48:44 Main name in hostent "eeyore" contains no '.', checking aliases 07/28 13:48:44 Checking alias "localhost.localdomain" 07/28 13:48:44 Alias "localhost.localdomain" is fully qualified 07/28 13:48:44 Trying to initialize local IP address (config file not read) 07/28 13:48:44 Already found IP with gethostbyname() 07/28 13:48:44 Trying to initialize local IP address (after reading config) 07/28 13:48:44 NETWORK_INTERFACE not in config file, using existing value FULL_HOSTNAME = localhost.localdomain HOSTNAME = eeyore IP_ADDRESS = 127.0.0.1
That is from my laptop, whose IP changes with the time of day and weather, and whose non-fully qualified name is listed in /etc/hosts.
Condor is doing its best to find a FQDN and associated IP. The heuristic used to identify a FQDN is presence of a period (.). Condor starts by calling
gethostname(), you can run
hostname. If that returns a FQDN,
gethostbyname() is called, you can run
hostname -i, to find the IP and done. If a non-FQDN is returned, all the IPs associated with the name are scanned looking for what is most likely a public IP. The heuristic prefers non-private over private over 127.0.0.1, where private are 10/8, 172.16/12, or 192.168/16. Once an IP is selected, the primary name and aliases for the IP are scanned for a FQDN, you can run
getent hosts $(hostname), and done.
Experimenting with various configurations, the best advice is to setup a system so
hostname returns a fully qualified name, and do not bother changing /etc/hosts.