Commands · reference
vmlab dns
vmlab dns prints the DNS zones the current lab's segments serve: every exact record, wildcard and sinkhole, in the order the resolver consults them. It is the thing to read when a guest cannot resolve a peer.
| Option | Meaning |
|---|---|
| --json | Emit the raw JSON instead of a table. |
| -h, --help | Print help. |
What it prints
The verb starts the lab daemon if none is running and asks it for the DNS table. Segments with no local zone, global segments and segments with dns { enabled = false }, serve nothing and are not listed; with no serving segment at all the verb prints `no segment in this lab serves DNS`.
Each serving segment gets a heading segment "<name>" — zone <suffix> and a table of NAME, IP and KIND. Exact records come first, sorted by name, with kind static for a record the lab file declares and dynamic for one a DHCP lease registered; then wildcards with kind wildcard; then sinkholes with - for the address and kind sinkhole/<mode>, since a sinkhole answers with nothing and NXDOMAIN and 0.0.0.0 fail differently in a guest. A zone with no rules prints (no records).
With --json the daemon's reply is printed verbatim as pretty JSON, an object with a segments array whose entries carry segment and a zone with suffix, records, wildcards and sinkholes.
Examples
Feed the table to a script:
| Exit status
Exit status is 0 when the table was printed. A lab directory that cannot be found, or a daemon that could not be started or answered with a failure, exits 1 (failed). Exit 5 (conflict) means the supervisor tracks a lab with this name from another directory. A usage error exits 2.