feat: DNS host suggestions, dns settings and links #48

Merged
Sebi merged 5 commits from feat/dns-suggest into main 2026-11-18 12:13:27 +00:00
Owner

Summary

  • DNS suggestions: a name neither in NetBox nor in the cache is resolved through DNS; the hosts owning the address (NetBox, cache, static hosts) are suggested together with a direct connection. Without a terminal the suggestions are part of the error. info, open and whois use it too.
  • dns.domains: domain rules per name pattern for short names (mx* → easysahre.de, ah* → jhfduwia.de), independent of shortcuts.domains.
  • dns.suggest / dns.save_link: ask (default), always (also in scripts) or never; editable in netssh configure → Resolver & cache.
  • Links: links: in the config and netssh link add|list|remove; netssh mx123 and the shell alias mx123 connect to the linked host, links complete with Tab.
  • Fix: generated command aliases honour command restrictions on site, role, platform, tenant and status.
  • Changelog entry v1.3.0.

Commits

  1. fix(hook): command alias restrictions
  2. feat(config): links and dns settings (+ wizard)
  3. feat: DNS suggestions
  4. feat: netssh link and shell aliases
  5. docs

Test plan

  • go vet ./... and go test ./... on every commit
  • Binary smoke test: rule-based domains, ask without terminal, always with automatic link, never, invalid values rejected, stdout stays clean

🤖 Generated with Claude Code

## Summary - **DNS suggestions:** a name neither in NetBox nor in the cache is resolved through DNS; the hosts owning the address (NetBox, cache, static hosts) are suggested together with a direct connection. Without a terminal the suggestions are part of the error. `info`, `open` and `whois` use it too. - **`dns.domains`:** domain rules per name pattern for short names (`mx*` → `easysahre.de`, `ah*` → `jhfduwia.de`), independent of `shortcuts.domains`. - **`dns.suggest` / `dns.save_link`:** `ask` (default), `always` (also in scripts) or `never`; editable in `netssh configure` → Resolver & cache. - **Links:** `links:` in the config and `netssh link add|list|remove`; `netssh mx123` and the shell alias `mx123` connect to the linked host, links complete with Tab. - **Fix:** generated command aliases honour command restrictions on site, role, platform, tenant and status. - Changelog entry v1.3.0. ## Commits 1. `fix(hook)`: command alias restrictions 2. `feat(config)`: links and dns settings (+ wizard) 3. `feat`: DNS suggestions 4. `feat`: `netssh link` and shell aliases 5. `docs` ## Test plan - [x] `go vet ./...` and `go test ./...` on every commit - [x] Binary smoke test: rule-based domains, `ask` without terminal, `always` with automatic link, `never`, invalid values rejected, stdout stays clean 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sebi added 5 commits 2026-11-18 12:08:10 +00:00
Generated command aliases checked commands.*.match against hosts without
their status, site, role, platform and tenant, so a restriction such as
match: {platform: junos} produced no aliases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- links: short names mapped to host selectors, validated against chains
  and static host names
- dns.suggest / dns.save_link: ask, always or never
- dns.domains: domain rules per name pattern (mx* -> easysahre.de)
- the wizard edits the dns settings under Resolver & cache and keeps links;
  setup.SaveTo reports to a chosen writer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
netssh link add|list|remove manages links; netssh NAME follows them, links
complete with Tab and get a shell alias.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs: document DNS suggestions, dns settings and links (v1.3.0)
Test / test (pull_request) Successful in 4m16s
080e52b437
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sebi merged commit 172258960e into main 2026-11-18 12:13:26 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Sebi/ssh-netbox-wrapper#48