feat: suggest the host behind unknown DNS names
A name neither in NetBox nor in the cache is resolved through DNS, using dns.domains for short names. The hosts owning the address in NetBox or the cache are offered together with a direct connection; without a terminal the suggestions are part of the error. Afterwards netssh offers to save the name as a link. info, open and whois use the same lookup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5c41a5eb6f
commit
793f095e80
5 files changed
+531
-9
No files matched your search
+6
-2
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
"text/tabwriter"
|
||||
@@ -146,8 +147,11 @@ func hostsRemoveCmd() *cobra.Command {
|
||||
}
|
||||
|
||||
// saveHosts writes the config and regenerates the shell aliases.
|
||||
func saveHosts(cfg *config.Config) error {
|
||||
if err := setup.Save(*cfg); err != nil {
|
||||
func saveHosts(cfg *config.Config) error { return saveHostsTo(cfg, os.Stdout) }
|
||||
|
||||
// saveHostsTo writes the config, reporting to w, and regenerates the aliases.
|
||||
func saveHostsTo(cfg *config.Config, w io.Writer) error {
|
||||
if err := setup.SaveTo(*cfg, w); err != nil {
|
||||
return err
|
||||
}
|
||||
loaded, err := config.Load()
|
||||
|
||||
Reference in new issue
Block a user