STAF to detect original hostname on Linux

I found that STAF on some my Linux boxes STAF doesn’t detect correct hostname.
Actually, “STAF/Config/Machine” variable reports localhost.localdomain.

The problem was in gethostbyname() function. It was clear from nohup.out file, where was the following message:

Even if you think that all settings are correct, there are some aspects, you need to take in consideraiton:
Hostname on the box should be the same as listed by reverse lookup.

  • Some of machines had different hostname set than DNS lookup returned for their ip. Solution: set correct hostname
  • Some machines could not resolve correctly set hostname. Solution: set correct mapping ip-hostname in /etc/hosts