Back to OpenVZ Documentation

    Hostname & FQDN

    Learn about VPS hostname requirements and whether you need a domain name.

    Short Answer: No

    No - the hostname is an arbitrary identifier for your VPS. It can be either a Fully Qualified Domain Name (FQDN) or just a simple name.

    What is a Hostname?

    A hostname is simply a label that identifies your server on a network. It's what you'll see when you log into your server, and what appears in various system logs and prompts.

    Valid Hostname Examples

    Simple Hostnames (No Domain Required)

    • webserver
    • db01
    • myserver
    • production-app

    FQDNs (With Domain)

    • web1.example.com
    • db.mydomain.org
    • server.mycompany.net

    When Does It Matter?

    Use a Simple Hostname When:

    • You're just getting started and don't have a domain
    • The server is for testing or development
    • You don't plan to send email from the server
    • You're using it for internal purposes only

    Use an FQDN When:

    • You're running a mail server (highly recommended)
    • You want proper SSL certificates
    • Running public-facing services
    • Professional or production environment

    Setting Your Hostname

    You can set or change your hostname at any time:

    On Debian/Ubuntu:

    hostnamectl set-hostname your-hostname
    # or for FQDN
    hostnamectl set-hostname server.yourdomain.com

    On CentOS/RHEL:

    hostnamectl set-hostname your-hostname
    # Edit /etc/hosts if needed
    nano /etc/hosts

    Verifying Your Hostname:

    hostname
    # or for FQDN
    hostname -f

    Email Server Note

    If you plan to run an email server, you should use an FQDN as your hostname and ensure it matches your reverse DNS (PTR) record. This helps with email deliverability and reduces the chance of your emails being marked as spam.