mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/ctrld: include DNS in interface list
This commit is contained in:
committed by
Cuong Manh Le
parent
1f2bd90308
commit
99b0cbedc3
@@ -340,6 +340,13 @@ func initCLI() {
|
||||
}
|
||||
fmt.Printf(" %v\n", ipaddr)
|
||||
}
|
||||
for i, dns := range currentDNS(i.Interface) {
|
||||
if i == 0 {
|
||||
fmt.Printf("DNS : %s\n", dns)
|
||||
continue
|
||||
}
|
||||
fmt.Printf(" : %s\n", dns)
|
||||
}
|
||||
println()
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/netip"
|
||||
"os/exec"
|
||||
@@ -85,7 +84,6 @@ func getDNSByResolvectl(iface string) []string {
|
||||
}
|
||||
parts = strings.Fields(parts[0])
|
||||
if len(parts) > 2 {
|
||||
fmt.Println(parts)
|
||||
return parts[3:]
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user