Created
August 6, 2022 11:06
-
-
Save willpower232/7ea6f3e0b016a98a4d776d10108d388a to your computer and use it in GitHub Desktop.
add your tailscale IPs to your hosts file when you're scared of messing up your DNS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
tailscale status | while IFS= read -r aHost; do | |
hostname=$(echo "$aHost" | awk '{print $2}' | cut -d '-' -f 1) | |
ip=$(echo "$aHost" | awk '{print $1}') | |
hostctl add domains tailscale "$hostname.ts" --ip "$ip" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://tailscale.com/
https://github.com/guumaster/hostctl
https://guumaster.github.io/hostctl/docs/cli-usage/add_domains/