Documentation
¶
Overview ¶
Package labzone parses -simulate-zone scenario files (#76). A scenario defines exact names, records, wildcards and failures for a lab exercise. A local DNS server answers from it, so a lab runs the real resolver, wildcard detection, -rate pacing and reliability guard, deterministically and without sending traffic off the machine.
The format is line based; # starts a comment. Names are relative to the scanned domain: @ is the domain itself, and *.dev is a wildcard covering every name under dev that the file does not define.
$DELAY 20ms # every answer waits this long $REFUSE-ABOVE 50 # answer REFUSED past 50 queries a second @ A 192.0.2.1 www A 192.0.2.10 www AAAA 2001:db8::10 shop CNAME www # relative target blog CNAME ghost.example.net. # absolute target (trailing dot) *.dev A 192.0.2.99 slow TIMEOUT # never answered broken SERVFAIL # also REFUSED, NXDOMAIN
Names the file does not define are NXDOMAIN (or NODATA when a deeper name exists under them). The server stands in for the student's resolver and the scenario is the whole world, so names outside the scanned domain (an external CNAME target, say) are NXDOMAIN too.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Zone ¶
type Zone struct {
Delay time.Duration // $DELAY
RefuseAbove int // $REFUSE-ABOVE; 0 means no limit
// contains filtered or unexported fields
}
Zone is a parsed scenario.