ping takes a name, and DNS can be read back (#1375) #1376
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1376
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/ping-name"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
pingtakes a name, and DNS can be read back. Fixes #1375.Simulator.ping()has accepted a hostname since #241: it resolves through the lab's DNS servers, emits adnsevent, and keeps NXDOMAIN, NODATA and SERVFAIL apart because they have different causes. The console refused
anything that was not an address before the engine saw it:
so the first command anybody types could not use the resolver the product already has. The same audit found
dns zone/dns addwith no way to read a zone back. Same family asshow power inline(#1295), the STP election(#1365), NAT (#1367), OSPF (#1371) and DHCP bindings (#1373).
ping <name>A name that does not resolve is refused before anything is sent, with the status the resolver reported and a
sentence that says what to fix:
Two smaller defects found on the way
ping 10.0.0.999passednet.isIp(), which only checks the shape (three dots, one to three digits) — theengine then threw
Invalid IPv4 addressat the first packet. The guard now asks whether every octet is in range,and digits-and-dots that are not an address are refused as an address rather than looked up as a name and
answered NXDOMAIN.
resolveName()reported the answering server by device label ("ISR 4331 branch router-r1"), which is notwhat a real box prints where an address belongs. It now carries
serverIdandserverIp, and the console printsthe address.
show ip dnsshow ip dns zone <name>narrows to one zone, an unknown name lists the zones that exist, a zone the server wouldrefuse to answer for prints
NOT answered: <reason>, a device with no zones says it is not a DNS server and namesthe command that would make it one, and with no resolver configured the report says lookups fall back to any
server in the lab — which is what
resolveName()actually does.Evidence
test/dns-console.test.js— 32 checks: the translation names the server by address and the address it resolvedto; a CNAME chain resolves to its target; an address is not translated; each of NXDOMAIN / NODATA / SERVFAIL gets
its own sentence and no echo is sent; a malformed address is refused as an address; the zone view prints A and
CNAME records in zone-file shape; every printed A record is checked against
dns.resolve(), so the page is aclaim that is verified rather than a rendering; an unknown zone lists the zones present; and a zone with an
unusable record is marked
NOT answered.engine/cli.js→ 29 of 32 failengine/simulator.js→ 1 of 32 (the server address in the translation)helpgains both commands;docs/CLI.mdgains "Pinging a name, and reading DNS";docs/SIMULATION.mdgains therow that says DNS is reported and how each failure is named.
Suite: 191 suites, 7,384 assertions, 0 failed. Syntax: 259 files, OK.