惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
Netflix TechBlog - Medium
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
V
V2EX
IT之家
IT之家
J
Java Code Geeks
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
GbyAI
GbyAI
D
Docker
S
Secure Thoughts
Recent Announcements
Recent Announcements
Webroot Blog
Webroot Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
云风的 BLOG
云风的 BLOG
博客园_首页
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Security Archives - TechRepublic
Security Archives - TechRepublic
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News | PayPal Newsroom
S
Security @ Cisco Blogs
I
InfoQ
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
W
WeLiveSecurity
T
Troy Hunt's Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Attack and Defense Labs
Attack and Defense Labs
美团技术团队
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
B
Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Scott Helme
Scott Helme
T
Tor Project blog
Know Your Adversary
Know Your Adversary
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Recorded Future
Recorded Future
C
Cyber Attacks, Cyber Crime and Cyber Security
AI
AI
G
Google Developers Blog

alexwlchan’s notes

A single command to test all my changed Go packages Disable the new message animations in WhatsApp Finding high-churn folders that bother Backblaze Always-on SSH agent forwarding with my Git pushes Managing the caption of a photo with AppleScript (but not PhotoKit) Goodhart’s and Campbell’s Law are different Notes from The Cornishman No. 176 (Spring 2026) Notes from The Cornishman No. 176 (Spring 2026) GitUp can’t diff text files larger than 8MB Home Testing the width of a page on a mobile device using Playwright Disable AirPods charging notifications Start a Caddy server in a subprocess during a Python session Filter a list of JSON object based on a list of tags HOME_GET_ME_HOME is a Citymapper Shortcuts action The FileExistsError exception exposes a filename attribute The red-lined bubble snail Why can’t Python connect to example.com? Useful type hints for Python How to truncate the middle of long command output AirPlay Receiver can interfere with Flask apps What’s the main prefix in SQLite queries? The file(1) command can read SQLite databases My randline project is tested by Crater Drawing an image with Liquid Glass using SwiftUI Previews Road signs in the Soviet union don’t have circular heads Setting up golink in my personal tailnet Create a file atomically in Go The SQLite command line shell will count your unclosed parentheses Use SQL triggers to prevent overwriting a value Testing date formatting with date-fns-tz and different timezones The “strangler” pattern is named after a tree, not an act of violence Place with the same name, but different etymology
Get a map of IP addresses for devices in my tailnet
2026-02-22 · via alexwlchan’s notes

Use tailscale status --json and filter the output using jq.

Here’s a jq snippet that prints the hostname and IP addresses of every device in my tailnet (or at least, every device my current machine can see):

$ tailscale status --json \
    | jq '[.Self] + [.Peer[]]
          | sort_by(.DNSName)
          | map({(.DNSName): (.TailscaleIPs)}) 
          | add'
{
  "phaenna-mac-mini.tailfa84dd.ts.net.": [
    "100.76.19.1",
    "fd7a:115c:a1e0::fb01:1301"
  ],

}

How it works:

  • [.Self] + [.Peer[]] combines the .Self object and .Peer array into a single array.
  • sort_by(.DNSName) sorts the array based on the DNSName field.
  • map({(.DNSName): (.TailscaleIPs)}) converts each entry in that array into a map where the DNSName is the key, and the TailscaleIPs array is the value. Now the output is an array of objects, each with a single key-value pair.
  • add combines all those objects into a single object.

Here’s a variant that keys the map by MagicDNS name:

$ tailscale status --json \
    | jq '[.Self] + [.Peer[]]
          | sort_by(.DNSName)
          | map({(.DNSName | split(".")[0]): (.TailscaleIPs)}) 
          | add'
{
  "phaenna-mac-mini": [
    "100.76.19.1",
    "fd7a:115c:a1e0::fb01:1301"
  ],

}

Another variant that just extracts the IPv4 address:

$ tailscale status --json \
    | jq '[.Self] + [.Peer[]]
          | sort_by(.DNSName)
          | map({(.DNSName | split(".")[0]): (.TailscaleIPs[0])}) 
          | add'
{
  "linode-vps": "100.98.193.6",
  "palaemon-macbook-air": "100.120.194.127",
  "phaenna-mac-mini": "100.76.19.1",

}

I paste this directly into the hosts section of my policy file.

If you have Mullvad nodes in your Tailnet, you can filter them out of this map with:

$ tailscale status --json \
    | jq '[.Self] + [.Peer[]]
          | map(select(.Tags == null or (.Tags | contains(["tag:mullvad-exit-node"]) | not)))
          | sort_by(.DNSName)
          | map({(.DNSName | split(".")[0]): (.TailscaleIPs[0])}) 
          | add'
{
  "linode-vps": "100.98.193.6",
  "palaemon-macbook-air": "100.120.194.127",
  "phaenna-mac-mini": "100.76.19.1",

}

Tested with Tailscale 1.95.104. Disclaimer: At time of writing, I’m employed by Tailscale.