cmd/ctrld: include DNS in interface list

This commit is contained in:
Cuong Manh Le
2023-01-19 11:01:10 +07:00
committed by Cuong Manh Le
parent 1f2bd90308
commit 99b0cbedc3
2 changed files with 7 additions and 2 deletions

View File

@@ -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 {

View File

@@ -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