ping refuses a hostname the engine can resolve, and DNS zones cannot be read #1375

Closed
opened 2026-11-10 19:47:38 +00:00 by jaylouisw · 0 comments
Owner

Simulator.ping() has accepted a hostname since #241 — it resolves through the lab's DNS servers, emits a dns
event, and keeps NXDOMAIN, NODATA and SERVFAIL apart. The console's ping refuses anything that is not an address
before the engine sees it:

if (!ip || !net.isIp(ip)) return ['% Invalid ping target: ' + (ip || '(none)')];

So the first command anybody types cannot use the resolver the product already has. ping server.lab answers
% Invalid ping target: server.lab.

Two more things in the same corner:

  • dns zone and dns add are writable, and there is no show ip dns — you can add a record and never see what
    the server would answer.
  • ping 10.0.0.999 passes net.isIp() (a shape check: three dots, one to three digits) and then the engine throws
    Invalid IPv4 address at the first packet.

What must be true instead

  1. ping <name> resolves first and prints the translation, the way a box does, naming the server by address.
  2. A name that does not resolve is refused before anything is sent, with the status the resolver actually reported
    and a sentence saying what to fix — NXDOMAIN, NODATA and SERVFAIL are different problems.
  3. show ip dns [zone [<name>]] prints the zones and records that are actually answered; a zone the server would
    refuse to answer for says so instead of appearing live.
  4. A malformed address is refused as an address, not looked up as a name.
`Simulator.ping()` has accepted a hostname since #241 — it resolves through the lab's DNS servers, emits a `dns` event, and keeps NXDOMAIN, NODATA and SERVFAIL apart. The console's `ping` refuses anything that is not an address **before the engine sees it**: ```js if (!ip || !net.isIp(ip)) return ['% Invalid ping target: ' + (ip || '(none)')]; ``` So the first command anybody types cannot use the resolver the product already has. `ping server.lab` answers `% Invalid ping target: server.lab`. Two more things in the same corner: * `dns zone` and `dns add` are writable, and there is **no `show ip dns`** — you can add a record and never see what the server would answer. * `ping 10.0.0.999` passes `net.isIp()` (a shape check: three dots, one to three digits) and then the engine throws `Invalid IPv4 address` at the first packet. ## What must be true instead 1. `ping <name>` resolves first and prints the translation, the way a box does, naming the server by **address**. 2. A name that does not resolve is refused before anything is sent, with the status the resolver actually reported and a sentence saying what to fix — NXDOMAIN, NODATA and SERVFAIL are different problems. 3. `show ip dns [zone [<name>]]` prints the zones and records that are actually answered; a zone the server would refuse to answer for says so instead of appearing live. 4. A malformed address is refused as an address, not looked up as a name.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1375
No description provided.