Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
IT Security NachrichtenBetrüger phishen mit vermeintlicher Reisebestätigung - IT-Markt(24.09.2026 um 23:41 Uhr)
••
Sicherheitslücken (CVE)IT Security News Daily Summary 2026-09-24(24.09.2026 um 23:55 Uhr)
•
Sicherheitslücken (CVE)IT Security News Roundup: 2026-09-24(24.09.2026 um 23:57 Uhr)
•
Sicherheitslücken (CVE)IT Security News Hourly Summary 2026-09-25 00h : 9 posts(25.09.2026 um 00:00 Uhr)
•••
IT NachrichtenMicrosoft puts Brad Smith in charge of communications(25.09.2026 um 00:08 Uhr)
•••
IT Security NachrichtenBetrüger phishen mit vermeintlicher Reisebestätigung - IT-Markt(24.09.2026 um 23:41 Uhr)
••
Sicherheitslücken (CVE)IT Security News Daily Summary 2026-09-24(24.09.2026 um 23:55 Uhr)
•
Sicherheitslücken (CVE)IT Security News Roundup: 2026-09-24(24.09.2026 um 23:57 Uhr)
•
Sicherheitslücken (CVE)IT Security News Hourly Summary 2026-09-25 00h : 9 posts(25.09.2026 um 00:00 Uhr)
•••
IT NachrichtenMicrosoft puts Brad Smith in charge of communications(25.09.2026 um 00:08 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

How to Set the Hostname on a Linux System

How to Set the Hostname on a Linux System When setting up a Linux machine, one of the first things you might want to do is assign a proper hostname. A hostname helps identify your machine within a network or even locally, making it…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




How to Set the Hostname on a Linux System



When setting up a Linux machine, one of the first things you might want to do is assign a proper hostname. A hostname helps identify your machine within a network or even locally, making it easier to manage and troubleshoot. In this guide, I'll show you how to set the hostname on Linux using the hostnamectl command.









What Is a Hostname?



A hostname is a unique identifier for a machine on a network. Think of it as the "name" of your system. Hostnames are typically used for:




  • Network communication

  • System administration

  • Identifying machines in logs



There are three types of hostnames:





  1. Static Hostname: The main, persistent hostname of your system.


  2. Pretty Hostname: A descriptive name that can include spaces or special characters (e.g., "My Cool Server").


  3. Transient Hostname: A temporary hostname used for the current session (resets after a reboot).









How to Set the Hostname



The easiest way to set a hostname on a Linux system is by using the hostnamectl command. This tool is part of systemd and allows you to manage the hostname easily.






Step 1: Check the Current Hostname



First, check the current hostname by running:




hostnamectl






Example output:




   Static hostname: (unset)
Transient hostname: localhost
Icon name: computer-server
Chassis: server
Machine ID: 2c9a10b57b9248e7bdf1c78b0f9ea8e1
Boot ID: 8e4bb01e03ef4147bbeb2c5bc74f8a6f
Operating System: Linux
Kernel: Linux 6.2.0-43-generic
Architecture: x86-64












Step 2: Set a New Static Hostname



To set a permanent static hostname, run:




sudo hostnamectl set-hostname workstation06






This will update the static hostname in the system configuration files.









Step 3: Set a Pretty Hostname (Optional)



If you want a more descriptive or user-friendly hostname for display purposes, use:




sudo hostnamectl set-hostname "My Awesome Server" --pretty






The pretty hostname is purely cosmetic and won’t affect network communication.









Step 4: Set a Transient Hostname (Optional)



To set a hostname that only lasts for the current session:




sudo hostnamectl set-hostname temporary-hostname --transient






Transient hostnames are often used for testing or debugging.









Step 5: Verify the New Hostname



After setting the hostname, confirm the changes:




hostnamectl






Example output:




   Static hostname: workstation06
Pretty hostname: My Awesome Server
Icon name: computer-server
Chassis: server
Machine ID: 2c9a10b57b9248e7bdf1c78b0f9ea8e1
Boot ID: 8e4bb01e03ef4147bbeb2c5bc74f8a6f
Operating System: Linux
Kernel: Linux 6.2.0-43-generic
Architecture: x86-64












Update the Hosts File



Changing the hostname doesn’t automatically update the /etc/hosts file. Edit it manually to avoid issues with local name resolution:




sudo nano /etc/hosts






Make sure it includes an entry like this:




127.0.1.1   workstation06






Save and close the file.









Additional Tips





  • Use a Valid Hostname: Hostnames should only contain alphanumeric characters, hyphens (-), and dots (.). Avoid starting or ending with a hyphen.


  • Restart Networking Services: Some services may require a restart to recognize the new hostname:




  sudo systemctl restart networking








  • Hostname Limitations: Avoid using the same hostname for multiple machines in the same network to prevent conflicts.









Conclusion



Setting a hostname on Linux is quick and straightforward with the hostnamectl command. Whether you’re configuring a server, a development machine, or just experimenting, this guide covers everything you need to know to manage hostnames effectively.



Feel free to comment below if you have questions or tips about managing hostnames in Linux!






What do you think? Is this guide helpful for your hostname-related tasks? Let me know! 😊

IoC Intelligence (2 Indikatoren)
2c9a10b57b9248e7bdf1c78b0f9ea8e18e4bb01e03ef4147bbeb2c5bc74f8a6f
CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - How to Set the Hostname on a Linux System
id: 8be7e735-d07a-4ddb-90a4-d735d1b55696
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-25
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-25"
        description = "YARA Signature for "
    strings:
        $str = "How to Set the Hostname on a L" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("How to Set the Hostname on a Linux Syste")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*How to Set the Hostname on a Linux Syste*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "How to Set the Hostname on a Linux Syste"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich How to Set the Hostname on a Linux Syste.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to Set the Hostname on a Linux System

Thematisch verwandte Begriffe: Hostname, Linux, System · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-87722 | Uncontrolled Resource Consumption (CWE-400 / CWE-1333) in regex search q…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...
↗ Original-Quelle