ZGENHOSTID(8)

πŸ“¦
version 2.4.4 Β· 6 versions
, in alpine 3.23, alpine 3.24, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

✨ zgenhostid β€” it's giving "make me a host ID" πŸ’–

okay bestie so this is zgenhostid, a section 8 system manager's manual page 🫢 she lives in the system administration corner of the man-page universe and she is very good at her one (1) job.


πŸŽ€ SYNOPSIS πŸŽ€

zgenhostid [-f] [-o filename] [hostid]

🌸 DESCRIPTION 🌸

So here's the tea β˜• β€” zgenhostid makes you an /etc/hostid file and tucks the host ID right up inside it. Iconic behavior, honestly.

Now, if you hand her a hostid, she'll validate that value and store it, periodt. But if you don't? She just randomly generates one for you, no questions asked, main character energy only πŸ’….


✨ OPTIONS ✨

  • -h β€” shows you a lil summary of the command-line options. a little menu, a little snack, yk? πŸ“
  • -f β€” lets the output get overwritten. yes bestie, she's giving you permission to clobber πŸ’€
  • -o filename β€” write to filename instead of the default /etc/hostid. your file, your rules πŸ¦‹
  • hostid β€” this is the value that gets placed into /etc/hostid. she needs it to be a number with a value between 1 and 2^32-1. and if it's 0? random ID time, we love a surprise 🌈
    • lowkey important: this value must be unique among your systems. no twinning allowed πŸ™ˆ
    • it has to be an 8-digit-long hexadecimal number, optionally prefixed by "0x".

🧚 FILES 🧚

  • /etc/hostid

πŸ’œ EXAMPLES πŸ’œ

Generate a random hostid and store it ✨

# zgenhostid

Record the libc-generated hostid in /etc/hostid 😌

# zgenhostid "$(hostid)"

Record a custom hostid (0xdeadbeef) in /etc/hostid πŸ”₯

# zgenhostid deadbeef

Record a custom hostid (0x01234567) in /tmp/hostid and overwrite the file if it exists πŸ‘‘

# zgenhostid -f -o /tmp/hostid 0x01234567

🌟 SEE ALSO 🌟

genhostid(1), hostid(1), sethostid(3), spl(4)


πŸ“œ HISTORY πŸ“œ

zgenhostid emulates the genhostid(1) utility, and she's provided for use on systems which don't include that utility or which don't provide the sethostid(3) function. she's the understudy that absolutely ate the role, no cap πŸ’…βœ¨


okay that's the whole page bestie, go forth and generate responsibly 🫢

πŸ’– this was brought to you by OpenZFS, dated July 11, 2022, and the manual page is ZGENHOSTID(8) β€” mwah, take care of her πŸ’–

πŸ“¦ where this page comes from