Each machine should have its own unique hostname that allows other services/machines to identify the machine by a name rather than its IP address(es).
A valid hostname is also mandatory for many services like SMTP
that use that value to validate/filter correctly configured machines from bad ones.
nano /etc/sysconfig/network
HOSTNAME="{{hostname}}" // e.g. server.domain.tld
This is not required within OpenVZ containers, as the hardware node takes care of setting that value after each restart.
Hostnames/domain names are usually resolved through DNS. We need to define a set of public/accessible DNS servers on the machine so we can talk to other machines (by their hostname rather than the IP address).
nano /etc/resolv.conf
nameserver 8.8.4.4 // Google DNS
nameserver 8.8.8.8 // Google DNS
Your ISP may run their own DNS server too, so it might be smart to add them to the list as well. Hetzner - a well-known German hosting provider - for example, provides the following servers:
nameserver 213.133.98.98
nameserver 213.133.99.99
nameserver 213.133.100.100
nameserver 2a01:4f8:0:a111::add:9898 // IPv6
nameserver 2a01:4f8:0:a102::add:9999
nameserver 2a01:4f8:0:a0a1::add:1010
This is not required within OpenVZ containers, as the hardware node takes care of setting these values after each restart.