dcg

Generic DNS Tools

dns.generic

Protects against destructive or risky DNS tooling usage (nsupdate deletes, zone transfers).

  • 4blocking rules
  • 3safe patterns
  • 2High
  • 2Medium
~/.config/dcg/config.toml
[packs]
enabled = ["dns.generic"]

Evaluated when a command contains nsupdate, dig, host, nslookup.

Blocking rules

Each rule ID is dns.generic:<name>. Use it in allowlists and [policy.rules].

  1. dns-nsupdate-delete

    High

    nsupdate delete commands remove DNS records.

    Explanation
    nsupdate delete removes DNS records from the authoritative server using dynamic DNS updates (RFC 2136). Changes take effect immediately and can break services relying on those records. Safer alternatives: - Test in a non-production zone first - Use 'prereq' commands to verify record state before delete - Keep backup of zone file or export current records
  2. stdin-unverified

    High

    nsupdate receives indirect input that dcg cannot statically verify.

    Explanation
    Materialize and review the exact nsupdate commands before piping, redirecting, or loading them into the client.
  3. dns-dig-zone-transfer

    Medium

    dig AXFR/IXFR zone transfers can exfiltrate full zone data.

    Explanation
    Zone transfers (AXFR/IXFR) download complete DNS zone data, revealing all hostnames, internal IPs, and infrastructure topology. This information aids reconnaissance for attacks. Most zones should restrict transfers to known secondary servers. Safer alternatives: - Use standard dig queries for specific records - Request zone transfer permissions through proper channels - Check if zone transfer is authorized for your IP
  4. dns-nsupdate-local

    Medium

    nsupdate -l applies local updates which can modify DNS records.

    Explanation
    nsupdate -l uses local (loopback) TSIG authentication, allowing DNS modifications without network credentials. This is convenient for local testing but can accidentally modify production DNS if run on the wrong server. Safer alternatives: - Verify you are on the intended server before running - Use explicit server and key options for clarity - Test changes with 'show' before 'send'

Safe patterns

Checked first. A command that matches one is never blocked by this pack.

  • dns-dig-safe
  • dns-host-safe
  • dns-nslookup-safe