Skip to content

Instantly share code, notes, and snippets.

@willpower232
Created August 6, 2022 11:06
Show Gist options
  • Save willpower232/7ea6f3e0b016a98a4d776d10108d388a to your computer and use it in GitHub Desktop.
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
#!/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