brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: tailscale set --hostname renames a device without logging in again

Network and access
~/tips/tip-tailscale-set-hostname

sudo tailscale set --hostname=nas

Changes the name a device uses on your tailnet, without rerunning tailscale up or the full settings.

Machines often join a tailnet with whatever name the operating system gave them, such as localhost or a default image name. Fixing that is one command.

sudo tailscale set --hostname=nas
tailscale get --help

According to the Tailscale CLI reference, tailscale set changes only the preferences you name. Unlike tailscale up, it does not need the full set of settings again, and there are no default values for the ones you leave out. The --hostname flag sets the hostname to use for the device instead of the one provided by the operating system.

The docs say that changing it also changes the machine name in MagicDNS. So after the command, the device answers to nas on the tailnet, and the admin console shows the new name. On Linux you usually need sudo, unless you have set yourself as the operator with tailscale set --operator=$USER.

tailscale get reads the current values of preferences.

Keep the name short, because you will type it often.

The caveat is that everything that uses the old MagicDNS name stops working, such as SSH config entries, bookmarks, monitoring checks and shared links. Change the name when nothing depends on it, or update those places in the same go. The hostname you set with Tailscale does not rename the machine itself, only its name on the tailnet.

Further reading: Tailscale docs: CLI reference (set)

More Network and access tips scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ tailscale exit-node suggest tailscale lock sign nodekey:1abddef1 tlpub:abcdef12 wg genpsk > peer1.psk Table = off All Network and access tips (163) All topics

Link