When implementing networking features (DNS, proxies, RPC/XPC), make behavior consistent with the correct layer and avoid imposing policy that breaks end-to-end semantics.
Guidelines: 1) Separate DNS defaults by layer
resolv.conf defaults.2) Normalize DNS names end-to-end
foo and foo. consistently).3) Make forwarding timeouts cascade
4) Decode DNS safely
Example (timeout cascading):
// In the forwarding client: remove arbitrary timeout when the downstream call cascades timeouts.
let _ = try await xpcSend(message: request)
Example (DNS normalization idea):
func normalize(_ hostname: String) -> String {
let s = hostname.hasSuffix(".") ? String(hostname.dropLast()) : hostname
return s.lowercased()
}