Tim:
Because the display, even when on the same machine, is still handled as server and client, using hostnames for the networking. A change of names or addresses, mid-use, can be a bit of a pain, too.
Natxo Asenjo:
fair enough, but if that were the case here, I would have this problem everythime, and that is not the case.
I'd expect that, too. However, do you sometimes find the computer thinks it's localhost.localdomain, and other times has a real domain/host name?
One possible cause for *sometimes* having problems like this, rather than consistent problems, can be having two DHCP servers on a LAN (such as a modem/router as well as something else), with one properly doling out addresses, another improperly doing so, and occasional clashes between them.