ycTIN
  • Security
    • PHP Oct 2026 Security Check
    • JWT Encoder / Decoder
    • Hash (MD5, SHA, CRC)
    • Strong Password Generator
    • UUID Generator
    • Password Protected Zip Archive
    • Free Self-Signed SSL Certificate Generator
  • Development
    • Excel to PHP Array
    • Excel to JSON
    • Excel to SQL (Insert)
    • Excel to HTML Table
    • Excel to Property List(.plist)
    • Bulk QRCode Generation
    • QR Code Generator
    • Scan QR / 2D Code
    • 2D Code Generator
    • Barcode Generator
    • Barcode Scanner
    • Flatten Dataset to Nested JSON
    • Array from var_dump()
    • serialize() / unserialize()
  • DevOps
    • Setup SSH Key Login
    • Crontab Generator
    • Change Hostname
    • Current IP Address & Location
    • WHOIS Lookup
    • Send to WhatsApp Number
  • Conversion
    • Unit Converter
    • Traditional Chinese and Simplified Chinese
    • UNIX Timestamp and ISO Date Time
    • Base64 Encode/Decode
    • Base64 to PDF
    • Bin to Hex
    • Cheque Amount to Words
    • Nested JSON to Flatten Dataset
    • Cross Device String Share
  • Others
    • SMS Length and Segments Calculator
    • Hong Kong Octopus Card No. Checksum Calculation
  • External
    • JSFiddle | test your javascript, css, html
    • moqups | mockup/wireframe tool
    • invision | prototyping tool
    • Regex 101 | regex tester
    • masOS CUPS | default printing settings
    • Google Fonts
    • Awesome JS | a collection of javascript libraries
    • SVG Minify
    • ApexCharts | free js chart library
    • App Icon Generator
  • BLOG

Change Hostname Without Reboot

Generate commands to change a hostname without rebooting. Run the block that matches the machine.

  • Ubuntu, Debian, RHEL, CentOS, Rocky, Alma 7 and later, Fedora, SUSE, Arch, and Amazon Linux use hostnamectl.
  • RHEL 6 and CentOS 6 write /etc/sysconfig/network. Alpine writes /etc/hostname.
  • macOS uses scutil. FreeBSD uses sysrc. Windows uses Rename-Computer.

Each Linux block also adds the name to /etc/hosts. A cloud image can put the old name back on the next boot unless preserve_hostname is true.