5 Commits
14 changed files with 13 additions and 5 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
# ekekDNSHelper # ekDNSHelper
A cross-platform CLI tool that resolves hostnames against DNS servers and writes the resulting IP-to-hostname mappings into the local hosts file. It manages a clearly delimited block within the hosts file so it can cleanly add and remove only its own entries. A cross-platform CLI tool that resolves hostnames against DNS servers and writes the resulting IP-to-hostname mappings into the local hosts file. It manages a clearly delimited block within the hosts file so it can cleanly add and remove only its own entries.
@@ -6,7 +6,7 @@ By default, ekdns performs **smart resolution**: it discovers the authoritative
Built as a single static binary with no runtime dependencies. Built as a single static binary with no runtime dependencies.
**Copyright (c) 2024 Emberkom LLC** **Copyright (c) 2026 Emberkom LLC**
## Features ## Features
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+11 -3
View File
@@ -85,11 +85,19 @@ func resolveDefault(hostname string, pool []string, localResolvers []string, con
if authority != nil { if authority != nil {
fmt.Fprintf(w, "[dns] Selected authority: %s → %s\n", fmt.Fprintf(w, "[dns] Selected authority: %s → %s\n",
authority.Zone, strings.Join(authority.Nameservers, ", ")) authority.Zone, strings.Join(authority.Nameservers, ", "))
return resolveAuthoritative(ctx, authority, hostname, pool, localResolvers, config, depth, w) ips, err := resolveAuthoritative(ctx, authority, hostname, pool, localResolvers, config, depth, w)
if err == nil {
return ips, nil
}
// Stage 2 failed (e.g. sub-zone delegation referral not followed) —
// fall through to Stage 3 parallel A fallback.
fmt.Fprintf(w, "[dns] Stage 2 failed: %v\n", err)
fmt.Fprintf(w, "[dns] Falling back to Stage 3 parallel A queries\n")
} else {
fmt.Fprintf(w, "[dns] Stage 1: No NS records found at any level\n")
} }
// Stage 3: No NS records found — fall back to parallel A queries. // Stage 3: Fall back to parallel recursive A queries.
fmt.Fprintf(w, "[dns] Stage 1: No NS records found at any level\n")
ips, err := ParallelAFallback(ctx, w, pool, hostname, timeout) ips, err := ParallelAFallback(ctx, w, pool, hostname, timeout)
if err != nil { if err != nil {
return nil, addPrivateTLDHint(hostname, err) return nil, addPrivateTLDHint(hostname, err)