Skip to content

Instantly share code, notes, and snippets.

@Zhann
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zhann/6765b9200fdb5f7b7e43 to your computer and use it in GitHub Desktop.
Save Zhann/6765b9200fdb5f7b7e43 to your computer and use it in GitHub Desktop.
# works as expected
core@coreos-1 ~ $ sudo hostnamectl set-hostname 'coreos-1.banteng.be'
core@coreos-1 ~ $ hostnamectl
Static hostname: coreos-1.banteng.be
Icon name: computer-vm
Chassis: vm
Machine ID: fcb997ab81144cdd8486ebed3da426bd
Boot ID: 7f40717efbe34fdbbc1d3efff6141d71
Virtualization: kvm
Operating System: CoreOS 723.3.0
Kernel: Linux 4.0.5
Architecture: x86-64
# will omit trailing dot for static hostname (as it's invalied)
core@coreos-1 ~ $ sudo hostnamectl set-hostname 'coreos-1.banteng.be.'
core@coreos-1 ~ $ hostnamectl
Static hostname: coreos-1.banteng.be
Pretty hostname: coreos-1.banteng.be.
Icon name: computer-vm
Chassis: vm
Machine ID: fcb997ab81144cdd8486ebed3da426bd
Boot ID: 7f40717efbe34fdbbc1d3efff6141d71
Virtualization: kvm
Operating System: CoreOS 723.3.0
Kernel: Linux 4.0.5
Architecture: x86-64
# setting it specifically for static or pretty
# (new node so transient is still set)
core@coreos-1 ~ $ sudo hostnamectl set-hostname --static coreos-1.banteng.be
core@coreos-1 ~ $ hostnamectl
Static hostname: coreos-1.banteng.be
Transient hostname: coreos-1
Icon name: computer-vm
Chassis: vm
Machine ID: fcb997ab81144cdd8486ebed3da426bd
Boot ID: 7f40717efbe34fdbbc1d3efff6141d71
Virtualization: kvm
Operating System: CoreOS 723.3.0
Kernel: Linux 4.0.5
Architecture: x86-64
core@coreos-1 ~ $ sudo hostnamectl set-hostname --static coreos-1.banteng.be.
Could not set property: Invalid static hostname 'coreos-1.banteng.be.'
core@coreos-1 ~ $ sudo hostnamectl set-hostname --pretty coreos-1.banteng.be.
core@coreos-1 ~ $ hostnamectl
Static hostname: coreos-1.banteng.be
Pretty hostname: coreos-1.banteng.be.
Transient hostname: coreos-1
Icon name: computer-vm
Chassis: vm
Machine ID: fcb997ab81144cdd8486ebed3da426bd
Boot ID: 7f40717efbe34fdbbc1d3efff6141d71
Virtualization: kvm
Operating System: CoreOS 723.3.0
Kernel: Linux 4.0.5
Architecture: x86-64
core@coreos-1 ~ $ sudo hostnamectl set-hostname --pretty 'coreos-1.banteng.be. whatever'
core@coreos-1 ~ $ hostnamectl
Static hostname: coreos-1.banteng.be
Pretty hostname: coreos-1.banteng.be. whatever
Transient hostname: coreos-1
Icon name: computer-vm
Chassis: vm
Machine ID: fcb997ab81144cdd8486ebed3da426bd
Boot ID: 7f40717efbe34fdbbc1d3efff6141d71
Virtualization: kvm
Operating System: CoreOS 723.3.0
Kernel: Linux 4.0.5
Architecture: x86-64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment