From 5acbb149a2c1079159f5efb9e45dd4acb6d7b0ab Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 27 Aug 2020 13:24:59 -0700 Subject: [PATCH] ipn/ipnstate: include DNSName in tailscale status --json output --- ipn/ipnstate/ipnstate.go | 4 ++++ ipn/local.go | 1 + 2 files changed, 5 insertions(+) diff --git a/ipn/ipnstate/ipnstate.go b/ipn/ipnstate/ipnstate.go index 55b9e11f7..703dca26c 100644 --- a/ipn/ipnstate/ipnstate.go +++ b/ipn/ipnstate/ipnstate.go @@ -45,6 +45,7 @@ func (s *Status) Peers() []key.Public { type PeerStatus struct { PublicKey key.Public HostName string // HostInfo's Hostname (not a DNS name or necessarily unique) + DNSName string OS string // HostInfo.OS UserID tailcfg.UserID @@ -166,6 +167,9 @@ func (sb *StatusBuilder) AddPeer(peer key.Public, st *PeerStatus) { if v := st.HostName; v != "" { e.HostName = v } + if v := st.DNSName; v != "" { + e.DNSName = v + } if v := st.Relay; v != "" { e.Relay = v } diff --git a/ipn/local.go b/ipn/local.go index 41d87c981..7a576c63a 100644 --- a/ipn/local.go +++ b/ipn/local.go @@ -166,6 +166,7 @@ func (b *LocalBackend) UpdateStatus(sb *ipnstate.StatusBuilder) { UserID: p.User, TailAddr: tailAddr, HostName: p.Hostinfo.Hostname, + DNSName: p.Name, OS: p.Hostinfo.OS, KeepAlive: p.KeepAlive, Created: p.Created,