Skip to main contentSkip to navigation
[email protected]
Client AreaSupport
Hosting Mammoth
HostingMammothYour Data, Our Responsibility
Home
Solutions
Hosting Services
Store
Pricing
About
Blog
API
Contact

Stay Ahead of the Curve

Get the latest insights on cybersecurity, AI innovations, and enterprise data solutions delivered to your inbox.

Hosting Mammoth
HostingMammothEnterprise Solutions

Enterprise-grade data solutions. Hosting, recovery, cybersecurity, and AI-powered services for businesses worldwide.

[email protected]
Sun - Fri, 9:00am - 5:00pm

Services

  • Cloud Hosting
  • Data Recovery
  • Cybersecurity
  • Legal Support
  • MSP Services
  • Web Development
  • AI Services
  • Free Server Migration

Hosting

  • VPS Hosting (NVMe SSD)
  • VDS Hosting (NVMe)
  • Storage VPS (High SSD)
  • GPU Servers
  • Managed Services
  • Cloud Firewall
  • Load Balancer
  • One-Click Apps
  • n8n Hosting
  • Object Storage
  • FAQ

Company

  • Store
  • Pricing
  • About Us
  • Locations
  • Blog
  • Testimonials
  • Contact
  • Affiliate Program
  • White-Label
  • Terms of Service
  • Privacy Policy
  • Browser Cookies
  • SLA

Support

  • Client Area
  • Submit Ticket
  • Knowledge Base
  • Server Status
  • API Documentation

© 2026 Hosting Mammoth. All rights reserved.

Knowledge Base
Getting StartedAccount ManagementVPS HostingGPU ServersStorage VPSCloud FirewallLoad BalancerServer ManagementBilling & PaymentsSupport & TicketsAffiliate ProgramReseller ProgramMarketplace & Appsn8n HostingManaged ServicesServer MigrationAPI & DevelopersSecurityTroubleshootingGlossaryInstall Guides
  1. Home
  2. /
  3. Support
  4. /
  5. Server Management
  6. /
  7. Server Hostname
GUIDEServer Management

Changing Your Server Hostname

5 min read

The hostname is the human-readable name assigned to your server that identifies it on a network. A properly configured hostname is important for system administration, email delivery, SSL certificates, and logging. This guide explains how to change your server hostname through both the Data Mammoth dashboard and the command line.

Understanding Hostnames

A hostname typically follows the format purpose.yourdomain.com. For example:

  • web01.example.com — A web server
  • db01.example.com — A database server
  • mail.example.com — A mail server
There are three types of hostnames on a Linux system:

  • Static hostname — The primary hostname stored on disk and used at boot.
  • Transient hostname — A temporary hostname that can be set at runtime and may be assigned by DHCP.
  • Pretty hostname — A free-form descriptive name (e.g., "Production Web Server") used for display purposes only.
  • Changing the Hostname via the Dashboard

    Data Mammoth allows you to update the server label (display name) directly from the dashboard:

  • Log in to your Data Mammoth dashboard.
  • Navigate to Servers and click your server.
  • Go to the Settings tab.
  • Find the Hostname or Server Name field.
  • Enter the new hostname and click Save.
  • Note that changing the hostname in the dashboard may update the display label only. To ensure the operating system reflects the new hostname, follow the command-line steps below.

    Changing the Hostname via Command Line

    Using hostnamectl (Recommended)

    The hostnamectl command is available on all modern Linux distributions and is the recommended method.

    bash
    # View current hostname
    hostnamectl

    Set a new hostname

    sudo hostnamectl set-hostname web01.example.com

    Verify the change:

    bash
    hostnamectl

    Updating /etc/hosts

    After changing the hostname, update the /etc/hosts file to reflect the new name:

    bash
    sudo nano /etc/hosts

    Ensure the file contains a line mapping the hostname to 127.0.1.1 (on Ubuntu/Debian) or 127.0.0.1:

    text
    127.0.0.1   localhost
    127.0.1.1   web01.example.com web01
    203.0.113.10 web01.example.com web01

    Save and exit.

    Ubuntu / Debian

    On Ubuntu and Debian, the static hostname is also stored in /etc/hostname:

    bash
    sudo nano /etc/hostname

    Replace the contents with your new hostname:

    text
    web01.example.com

    Save and exit.

    CentOS / AlmaLinux

    On CentOS and AlmaLinux, hostnamectl handles everything. No additional file edits are required unless you want to update /etc/hosts as described above.

    Verifying the Change

    After updating the hostname, verify it is applied correctly:

    bash
    # Check the static hostname
    hostname

    Check the fully qualified domain name

    hostname -f

    Full details

    hostnamectl

    You may need to open a new terminal session or SSH connection to see the updated hostname in your shell prompt.

    Hostname Best Practices

    Naming Conventions

    Choose hostnames that are meaningful and consistent across your infrastructure:

    • Use lowercase letters, numbers, and hyphens only.
    • Keep it short but descriptive (e.g., app01, db-primary).
    • Include the domain for the FQDN (e.g., app01.example.com).
    • Avoid special characters, spaces, and underscores in hostnames.
    • Do not use IP addresses as hostnames.

    For Multiple Servers

    If you manage several servers, adopt a consistent naming pattern:

    PatternExample
    Role + numberweb01, web02, db01
    Environment + roleprod-web01, staging-app01
    Location + roleus-east-web01, eu-west-db01

    DNS Considerations

    If you set a fully qualified domain name (FQDN) as your hostname, ensure a corresponding DNS A record exists pointing to your server's IP address. This is especially important for:

    • Email delivery — Mail servers check that the hostname resolves correctly.
    • SSL certificates — Certificates are issued for specific domain names.
    • Reverse DNS — The PTR record for your IP should match your hostname for email deliverability. See Server Networking — IPs, DNS, Reverse DNS.

    When to Change Your Hostname

    Common reasons to update your hostname:

    • Initial server setup — Replace the default hostname with a meaningful one.
    • Server repurposing — When changing a server's role (e.g., from development to production).
    • Domain changes — If you migrate to a new domain name.
    • Compliance — Some security standards require descriptive hostnames for audit trails.

    Impact of Changing the Hostname

    Changing the hostname can affect some services:

    • Running services — Most services do not need to be restarted, but some (like Apache, Postfix, or monitoring agents) may reference the old hostname in their configuration.
    • SSL certificates — If your certificate was issued for the old hostname, you may need to obtain a new one.
    • Monitoring — If you use external monitoring tools, update the hostname reference there as well.
    • Logs — The new hostname will appear in new log entries, while old entries retain the previous hostname.

    What to Do Next

    • Server Networking — IPs, DNS, Reverse DNS — Configure DNS records for your hostname.
    • Initial Server Setup — Ubuntu 22.04/24.04 — Complete server setup guide.
    • SSL/TLS Certificates — Setup & Renewal — Set up SSL for your domain.
    • Organizing Servers with Labels — Label and group your servers.

    Was this article helpful?

    ← Back to Server ManagementBrowse all categories →

    Still have questions?

    Contact Support →Submit a Ticket